From: Amitkumar Karwar <amitkarwar@gmail.com>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: linux-wireless@vger.kernel.org,
Amitkumar Karwar <amit.karwar@redpinesignals.com>,
Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Subject: [v2 06/11] rsi: handle station disconnection in AP mode
Date: Wed, 16 Aug 2017 18:43:13 +0530 [thread overview]
Message-ID: <1502889198-4478-7-git-send-email-amitkarwar@gmail.com> (raw)
In-Reply-To: <1502889198-4478-1-git-send-email-amitkarwar@gmail.com>
From: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
When sta_remove of mac80211 is called, driver iterates through
list of existing stations to get the station id. Then peer notify
is prepared and send to firmare.
Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
---
drivers/net/wireless/rsi/rsi_91x_mac80211.c | 56 +++++++++++++++++++++++------
1 file changed, 45 insertions(+), 11 deletions(-)
diff --git a/drivers/net/wireless/rsi/rsi_91x_mac80211.c b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
index b1c0849..be10d50 100644
--- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c
+++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
@@ -1254,21 +1254,55 @@ static int rsi_mac80211_sta_remove(struct ieee80211_hw *hw,
{
struct rsi_hw *adapter = hw->priv;
struct rsi_common *common = adapter->priv;
+ struct ieee80211_bss_conf *bss = &vif->bss_conf;
+ struct rsi_sta *rsta;
+
+ rsi_dbg(INFO_ZONE, "Station Remove: %pM\n", sta->addr);
mutex_lock(&common->mutex);
- /* Resetting all the fields to default values */
- common->bitrate_mask[NL80211_BAND_2GHZ] = 0;
- common->bitrate_mask[NL80211_BAND_5GHZ] = 0;
- common->min_rate = 0xffff;
- common->vif_info[0].is_ht = false;
- common->vif_info[0].sgi = false;
- common->vif_info[0].seq_start = 0;
- common->secinfo.ptk_cipher = 0;
- common->secinfo.gtk_cipher = 0;
+ if (vif->type == NL80211_IFTYPE_AP) {
+ u8 sta_idx, cnt;
- rsi_send_rx_filter_frame(common, 0);
-
+ /* Send peer notify to device */
+ rsi_dbg(INFO_ZONE, "Indicate bss status to device\n");
+ for (sta_idx = 0; sta_idx < common->max_stations; sta_idx++) {
+ rsta = &common->stations[sta_idx];
+
+ if (!rsta->sta)
+ continue;
+ if (!memcmp(rsta->sta->addr, sta->addr, ETH_ALEN)) {
+ rsi_inform_bss_status(common, AP_OPMODE, 0,
+ sta->addr, sta->wme,
+ sta->aid, sta, sta_idx);
+ rsta->sta = NULL;
+ rsta->sta_id = -1;
+ for (cnt = 0; cnt < IEEE80211_NUM_TIDS; cnt++)
+ rsta->start_tx_aggr[cnt] = false;
+ if (common->num_stations > 0)
+ common->num_stations--;
+ break;
+ }
+ }
+ if (sta_idx >= common->max_stations)
+ rsi_dbg(ERR_ZONE, "%s: No station found\n", __func__);
+ }
+
+ if (vif->type == NL80211_IFTYPE_STATION) {
+ /* Resetting all the fields to default values */
+ memcpy((u8 *)bss->bssid, (u8 *)sta->addr, ETH_ALEN);
+ bss->qos = sta->wme;
+ common->bitrate_mask[NL80211_BAND_2GHZ] = 0;
+ common->bitrate_mask[NL80211_BAND_5GHZ] = 0;
+ common->min_rate = 0xffff;
+ common->vif_info[0].is_ht = false;
+ common->vif_info[0].sgi = false;
+ common->vif_info[0].seq_start = 0;
+ common->secinfo.ptk_cipher = 0;
+ common->secinfo.gtk_cipher = 0;
+ if (!common->iface_down)
+ rsi_send_rx_filter_frame(common, 0);
+ }
mutex_unlock(&common->mutex);
return 0;
--
2.7.4
next prev parent reply other threads:[~2017-08-16 13:18 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-16 13:13 [v2 00/11] rsi: support for AP mode Amitkumar Karwar
2017-08-16 13:13 ` [v2 01/11] rsi: advertise ap mode support Amitkumar Karwar
2017-08-17 7:07 ` [v2,01/11] " Kalle Valo
2017-08-16 13:13 ` [v2 02/11] rsi: add interface changes for ap mode Amitkumar Karwar
2017-08-16 13:13 ` [v2 03/11] rsi: remove interface changes for AP mode Amitkumar Karwar
2017-08-16 13:13 ` [v2 04/11] rsi: add beacon " Amitkumar Karwar
2017-08-16 13:13 ` [v2 05/11] rsi: handle station connection in " Amitkumar Karwar
2017-08-16 13:13 ` Amitkumar Karwar [this message]
2017-08-16 13:13 ` [v2 07/11] rsi: data and managemet path changes for " Amitkumar Karwar
2017-08-16 13:13 ` [v2 08/11] rsi: use common descriptor for auto rate frame Amitkumar Karwar
2017-08-16 13:13 ` [v2 09/11] rsi: update tx auto rate command frame for AP mode Amitkumar Karwar
2017-08-16 13:13 ` [v2 10/11] rsi: aggregation parameters " Amitkumar Karwar
2017-08-16 13:13 ` [v2 11/11] rsi: security enhancements " Amitkumar Karwar
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=1502889198-4478-7-git-send-email-amitkarwar@gmail.com \
--to=amitkarwar@gmail.com \
--cc=amit.karwar@redpinesignals.com \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=prameela.j04cs@gmail.com \
/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).