From: Jerome Pouiller <Jerome.Pouiller@silabs.com>
To: devel@driverdev.osuosl.org, linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Kalle Valo" <kvalo@codeaurora.org>,
"David S . Miller" <davem@davemloft.net>,
"Jérôme Pouiller" <jerome.pouiller@silabs.com>
Subject: [PATCH 14/16] staging: wfx: simplify wfx_remove_interface()
Date: Mon, 20 Apr 2020 18:03:09 +0200 [thread overview]
Message-ID: <20200420160311.57323-15-Jerome.Pouiller@silabs.com> (raw)
In-Reply-To: <20200420160311.57323-1-Jerome.Pouiller@silabs.com>
From: Jérôme Pouiller <jerome.pouiller@silabs.com>
In wfx_remove_interface(), the current code differentiate AP and Station
cases. However, it is not necessary. In all cases, the only important
thing is the call to hif_reset(). We can use the same code to support
all cases.
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
drivers/staging/wfx/sta.c | 17 ++---------------
1 file changed, 2 insertions(+), 15 deletions(-)
diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index bc891b6e4392..1732f3d0a1e5 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -785,24 +785,11 @@ void wfx_remove_interface(struct ieee80211_hw *hw,
mutex_lock(&wdev->conf_mutex);
WARN(wvif->link_id_map != 1, "corrupted state");
- switch (wvif->state) {
- case WFX_STATE_PRE_STA:
- case WFX_STATE_STA:
- case WFX_STATE_IBSS:
- wfx_do_unjoin(wvif);
- break;
- case WFX_STATE_AP:
- /* reset.link_id = 0; */
- hif_reset(wvif, false);
- break;
- default:
- break;
- }
+ hif_reset(wvif, false);
wvif->state = WFX_STATE_PASSIVE;
-
- /* FIXME: In add to reset MAC address, try to reset interface */
hif_set_macaddr(wvif, NULL);
+ wfx_tx_policy_init(wvif);
cancel_delayed_work_sync(&wvif->beacon_loss_work);
wdev->vif[wvif->id] = NULL;
--
2.26.1
next prev parent reply other threads:[~2020-04-20 16:04 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-20 16:02 [PATCH 00/16] staging: wfx: rework the handling of the connection loss Jerome Pouiller
2020-04-20 16:02 ` [PATCH 01/16] staging: wfx: simplify the check if the the device is associated Jerome Pouiller
2020-04-20 16:02 ` [PATCH 02/16] staging: wfx: use ieee80211_beacon_loss() provided by mac80211 Jerome Pouiller
2020-04-20 16:02 ` [PATCH 03/16] staging: wfx: drop useless attribute 'bss_params' Jerome Pouiller
2020-04-20 16:02 ` [PATCH 04/16] staging: wfx: handle firmware events synchronously Jerome Pouiller
2020-04-20 16:03 ` [PATCH 05/16] staging: wfx: also fix network parameters for IBSS networks Jerome Pouiller
2020-04-20 16:03 ` [PATCH 06/16] staging: wfx: dual CTS is never necessary Jerome Pouiller
2020-04-20 16:03 ` [PATCH 07/16] staging: wfx: field operational_rate_set is ignored by firmware Jerome Pouiller
2020-04-20 16:03 ` [PATCH 08/16] staging: wfx: simplify hif_set_bss_params() Jerome Pouiller
2020-04-20 16:03 ` [PATCH 09/16] staging: wfx: drop useless update of field basic_rate_set Jerome Pouiller
2020-04-20 16:03 ` [PATCH 10/16] staging: wfx: introduce wfx_set_default_unicast_key() Jerome Pouiller
2020-04-20 16:03 ` [PATCH 11/16] staging: wfx: keys are kept during whole firmware life Jerome Pouiller
2020-04-20 16:03 ` [PATCH 12/16] staging: wfx: drop protection for asynchronous join during scan Jerome Pouiller
2020-04-20 16:03 ` [PATCH 13/16] staging: wfx: drop useless checks in wfx_do_unjoin() Jerome Pouiller
2020-04-20 16:03 ` Jerome Pouiller [this message]
2020-04-20 16:03 ` [PATCH 15/16] staging: wfx: drop unused enum wfx_state Jerome Pouiller
2020-04-20 16:03 ` [PATCH 16/16] staging: wfx: drop unused attribute 'join_complete_status' Jerome Pouiller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200420160311.57323-15-Jerome.Pouiller@silabs.com \
--to=jerome.pouiller@silabs.com \
--cc=davem@davemloft.net \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=kvalo@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).