developer | 83ad30d | 2023-09-12 17:28:06 +0800 | [diff] [blame] | 1 | From 244189a8c4412ac16301678a7683f4eb2545d657 Mon Sep 17 00:00:00 2001 |
developer | 54752a0 | 2023-08-08 19:53:11 +0800 | [diff] [blame] | 2 | From: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| 3 | Date: Mon, 7 Aug 2023 19:00:53 +0800 |
developer | 83ad30d | 2023-09-12 17:28:06 +0800 | [diff] [blame] | 4 | Subject: [PATCH 21/21] mac80211: mtk: avoid calling switch_vif_chanctx when |
developer | 54752a0 | 2023-08-08 19:53:11 +0800 | [diff] [blame] | 5 | use_chanctx is false |
| 6 | |
| 7 | Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| 8 | --- |
| 9 | net/mac80211/chan.c | 14 ++++++++------ |
| 10 | 1 file changed, 8 insertions(+), 6 deletions(-) |
| 11 | |
| 12 | diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c |
developer | 83ad30d | 2023-09-12 17:28:06 +0800 | [diff] [blame] | 13 | index 6895275..96f1ad0 100644 |
developer | 54752a0 | 2023-08-08 19:53:11 +0800 | [diff] [blame] | 14 | --- a/net/mac80211/chan.c |
| 15 | +++ b/net/mac80211/chan.c |
developer | 83ad30d | 2023-09-12 17:28:06 +0800 | [diff] [blame] | 16 | @@ -1304,13 +1304,15 @@ ieee80211_link_use_reserved_reassign(struct ieee80211_link_data *link) |
developer | 54752a0 | 2023-08-08 19:53:11 +0800 | [diff] [blame] | 17 | list_del(&link->reserved_chanctx_list); |
| 18 | link->reserved_chanctx = NULL; |
| 19 | |
| 20 | - err = drv_switch_vif_chanctx(local, vif_chsw, 1, |
| 21 | - CHANCTX_SWMODE_REASSIGN_VIF); |
| 22 | - if (err) { |
| 23 | - if (ieee80211_chanctx_refcount(local, new_ctx) == 0) |
| 24 | - ieee80211_free_chanctx(local, new_ctx); |
| 25 | + if (local->use_chanctx) { |
| 26 | + err = drv_switch_vif_chanctx(local, vif_chsw, 1, |
| 27 | + CHANCTX_SWMODE_REASSIGN_VIF); |
| 28 | + if (err) { |
| 29 | + if (ieee80211_chanctx_refcount(local, new_ctx) == 0) |
| 30 | + ieee80211_free_chanctx(local, new_ctx); |
| 31 | |
| 32 | - goto out; |
| 33 | + goto out; |
| 34 | + } |
| 35 | } |
| 36 | |
| 37 | list_move(&link->assigned_chanctx_list, &new_ctx->assigned_links); |
| 38 | -- |
developer | 83ad30d | 2023-09-12 17:28:06 +0800 | [diff] [blame] | 39 | 2.39.2 |
developer | 54752a0 | 2023-08-08 19:53:11 +0800 | [diff] [blame] | 40 | |