developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 1 | From 097b204ffed838a4bbf7649fb23310f64ace22ad Mon Sep 17 00:00:00 2001 |
| 2 | From: Evelyn Tsai <evelyn.tsai@mediatek.com> |
| 3 | Date: Thu, 11 May 2023 14:12:44 +0800 |
| 4 | Subject: [PATCH 102/103] hostapd: mtk: Fix unexpected AP beacon state |
| 5 | transition |
| 6 | |
| 7 | When AP fails setting the beacon, it assigns bss->beacon_set to 0 no |
| 8 | matter what the error number is. |
| 9 | However, in the case that the error number is -EBUSY, the driver might |
| 10 | not free the beacon and expect a later beacon re-setting. If hostapd set |
| 11 | a new beacon under this case, driver will return -EALREADY. |
| 12 | This patch checks the error number after hostapd fails setting the |
| 13 | beacon. If the error number is -EBUSY, bss->beacon_set will not be |
| 14 | assigned to 0. |
| 15 | |
| 16 | Signed-off-by: Michael Lee <michael-cy.lee@mediatek.com> |
| 17 | --- |
| 18 | src/drivers/driver_nl80211.c | 3 ++- |
| 19 | 1 file changed, 2 insertions(+), 1 deletion(-) |
| 20 | |
| 21 | diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c |
| 22 | index 8400e57..ccfc2d0 100644 |
| 23 | --- a/src/drivers/driver_nl80211.c |
| 24 | +++ b/src/drivers/driver_nl80211.c |
| 25 | @@ -5126,7 +5126,8 @@ static int wpa_driver_nl80211_set_ap(void *priv, |
| 26 | ret, strerror(-ret)); |
| 27 | if (!bss->flink->beacon_set) |
| 28 | ret = 0; |
| 29 | - bss->flink->beacon_set = 0; |
| 30 | + if (ret != -EBUSY) |
| 31 | + bss->flink->beacon_set = 0; |
| 32 | } else { |
| 33 | bss->flink->beacon_set = 1; |
| 34 | nl80211_set_bss(bss, params->cts_protect, params->preamble, |
| 35 | -- |
| 36 | 2.18.0 |
| 37 | |