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