developer | 617abbd | 2024-04-23 14:50:01 +0800 | [diff] [blame^] | 1 | From d9d2bfeed54c0506a2f387354464d3ef474e1777 Mon Sep 17 00:00:00 2001 |
| 2 | From: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| 3 | Date: Mon, 7 Aug 2023 19:00:53 +0800 |
| 4 | Subject: [PATCH 24/61] mtk: mac80211: avoid calling switch_vif_chanctx when |
| 5 | use_chanctx is false |
| 6 | |
| 7 | Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| 8 | Change-Id: I2876d763ed1ecb5b7c7e5c53b2623dcd34ece774 |
| 9 | --- |
| 10 | net/mac80211/chan.c | 14 ++++++++------ |
| 11 | 1 file changed, 8 insertions(+), 6 deletions(-) |
| 12 | |
| 13 | diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c |
| 14 | index 32094ef..8043d1d 100644 |
| 15 | --- a/net/mac80211/chan.c |
| 16 | +++ b/net/mac80211/chan.c |
| 17 | @@ -1219,13 +1219,15 @@ ieee80211_link_use_reserved_reassign(struct ieee80211_link_data *link) |
| 18 | list_del(&link->reserved_chanctx_list); |
| 19 | link->reserved_chanctx = NULL; |
| 20 | |
| 21 | - err = drv_switch_vif_chanctx(local, vif_chsw, 1, |
| 22 | - CHANCTX_SWMODE_REASSIGN_VIF); |
| 23 | - if (err) { |
| 24 | - if (ieee80211_chanctx_refcount(local, new_ctx) == 0) |
| 25 | - ieee80211_free_chanctx(local, new_ctx, false); |
| 26 | + if (!local->emulate_chanctx) { |
| 27 | + err = drv_switch_vif_chanctx(local, vif_chsw, 1, |
| 28 | + CHANCTX_SWMODE_REASSIGN_VIF); |
| 29 | + if (err) { |
| 30 | + if (ieee80211_chanctx_refcount(local, new_ctx) == 0) |
| 31 | + ieee80211_free_chanctx(local, new_ctx, false); |
| 32 | |
| 33 | - goto out; |
| 34 | + goto out; |
| 35 | + } |
| 36 | } |
| 37 | |
| 38 | list_move(&link->assigned_chanctx_list, &new_ctx->assigned_links); |
| 39 | -- |
| 40 | 2.39.2 |
| 41 | |