mac80211: fix build with linux kernel 6.6
[openwrt/staging/stintel.git] / package / kernel / mac80211 / patches / subsys / 301-mac80211-sta-randomize-BA-session-dialog-token-alloc.patch
index ec1e1d12ebbd674dc69dc9213f42b1f1ede0a0a2..1034e2c928fd2205986493c5dc48ae102fa61cfb 100644 (file)
@@ -28,11 +28,15 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
 
 --- a/net/mac80211/sta_info.c
 +++ b/net/mac80211/sta_info.c
-@@ -561,6 +561,7 @@ __sta_info_alloc(struct ieee80211_sub_if
+@@ -561,6 +561,11 @@ __sta_info_alloc(struct ieee80211_sub_if
        INIT_WORK(&sta->drv_deliver_wk, sta_deliver_ps_frames);
        INIT_WORK(&sta->ampdu_mlme.work, ieee80211_ba_session_work);
        mutex_init(&sta->ampdu_mlme.mtx);
++#if LINUX_VERSION_IS_LESS(6,2,0)
 +      sta->ampdu_mlme.dialog_token_allocator = prandom_u32_max(U8_MAX);
++#else
++      sta->ampdu_mlme.dialog_token_allocator = get_random_u32_below(U8_MAX);
++#endif
  #ifdef CPTCFG_MAC80211_MESH
        if (ieee80211_vif_is_mesh(&sdata->vif)) {
                sta->mesh = kzalloc(sizeof(*sta->mesh), gfp);