mac80211: move CRC into struct ieee802_11_elems
authorJohannes Berg <johannes.berg@intel.com>
Mon, 20 Sep 2021 13:40:08 +0000 (15:40 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 23 Sep 2021 14:26:43 +0000 (16:26 +0200)
We're currently returning this value, but to prepare for
returning the allocated structure, move it into there.

Link: https://lore.kernel.org/r/20210920154009.479b8ebf999d.If0d4ba75ee38998dc3eeae25058aa748efcb2fc9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/ieee80211_i.h
net/mac80211/mlme.c
net/mac80211/util.c

index d74031b..6a129a0 100644 (file)
@@ -1507,6 +1507,7 @@ struct ieee80211_csa_ie {
 struct ieee802_11_elems {
        const u8 *ie_start;
        size_t total_len;
+       u32 crc;
 
        /* pointers to IEs */
        const struct ieee80211_tdls_lnkie *lnk_id;
@@ -2193,10 +2194,10 @@ static inline void ieee80211_tx_skb(struct ieee80211_sub_if_data *sdata,
        ieee80211_tx_skb_tid(sdata, skb, 7);
 }
 
-u32 ieee802_11_parse_elems_crc(const u8 *start, size_t len, bool action,
-                              struct ieee802_11_elems *elems,
-                              u64 filter, u32 crc, u8 *transmitter_bssid,
-                              u8 *bss_bssid);
+void ieee802_11_parse_elems_crc(const u8 *start, size_t len, bool action,
+                               struct ieee802_11_elems *elems,
+                               u64 filter, u32 crc, u8 *transmitter_bssid,
+                               u8 *bss_bssid);
 static inline void ieee802_11_parse_elems(const u8 *start, size_t len,
                                          bool action,
                                          struct ieee802_11_elems *elems,
index c0ea3b1..39b3ed8 100644 (file)
@@ -4070,10 +4070,11 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
         */
        if (!ieee80211_is_s1g_beacon(hdr->frame_control))
                ncrc = crc32_be(0, (void *)&mgmt->u.beacon.beacon_int, 4);
-       ncrc = ieee802_11_parse_elems_crc(variable,
-                                         len - baselen, false, &elems,
-                                         care_about_ies, ncrc,
-                                         mgmt->bssid, bssid);
+       ieee802_11_parse_elems_crc(variable,
+                                  len - baselen, false, &elems,
+                                  care_about_ies, ncrc,
+                                  mgmt->bssid, bssid);
+       ncrc = elems.crc;
 
        if (ieee80211_hw_check(&local->hw, PS_NULLFUNC_STACK) &&
            ieee80211_check_tim(elems.tim, elems.tim_len, bss_conf->aid)) {
index 49cb96d..43ccad8 100644 (file)
@@ -1461,10 +1461,10 @@ static size_t ieee802_11_find_bssid_profile(const u8 *start, size_t len,
        return found ? profile_len : 0;
 }
 
-u32 ieee802_11_parse_elems_crc(const u8 *start, size_t len, bool action,
-                              struct ieee802_11_elems *elems,
-                              u64 filter, u32 crc, u8 *transmitter_bssid,
-                              u8 *bss_bssid)
+void ieee802_11_parse_elems_crc(const u8 *start, size_t len, bool action,
+                               struct ieee802_11_elems *elems,
+                               u64 filter, u32 crc, u8 *transmitter_bssid,
+                               u8 *bss_bssid)
 {
        const struct element *non_inherit = NULL;
        u8 *nontransmitted_profile;
@@ -1516,7 +1516,7 @@ u32 ieee802_11_parse_elems_crc(const u8 *start, size_t len, bool action,
 
        kfree(nontransmitted_profile);
 
-       return crc;
+       elems->crc = crc;
 }
 
 void ieee80211_regulatory_limit_wmm_params(struct ieee80211_sub_if_data *sdata,