[PATCH 2/4] In AP mode notify upper layers whet sta was lost
Eugene Krasnikov
k.eugene.e at gmail.com
Mon Jul 29 14:06:23 EDT 2013
HW will notify driver through delete_sta_context_ind that sta was lost.
Report low ack to wpa_supplicant so it can take an action on that.
wpa_supplicant will disconnect sta if in conf file flag is set like
this disassoc_low_ack=1.
Signed-off-by: Eugene Krasnikov <k.eugene.e at gmail.com>
---
hal.h | 4 ++--
smd.c | 27 +++++++++++++++++++++++++++
2 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/hal.h b/hal.h
index e45f8b1..2b9f1b9 100644
--- a/hal.h
+++ b/hal.h
@@ -2854,7 +2854,7 @@ struct send_unknown_frame_rx_ind_msg {
u32 status;
};
-struct delete_sta_context_ind_msg {
+struct wcn36xx_hal_delete_sta_context_ind_msg {
struct wcn36xx_hal_msg_header header;
u16 aid;
@@ -2868,7 +2868,7 @@ struct delete_sta_context_ind_msg {
/* To unify the keepalive / unknown A2 / tim-based disa */
u16 reason_code;
-};
+} __packed;
struct indicate_del_sta {
struct wcn36xx_hal_msg_header header;
diff --git a/smd.c b/smd.c
index 4924e6c..13a795f 100644
--- a/smd.c
+++ b/smd.c
@@ -1382,6 +1382,30 @@ static int wcn36xx_smd_missed_beacon_ind(struct wcn36xx *wcn,
return 0;
}
+static int wcn36xx_smd_delete_sta_context_ind(struct wcn36xx *wcn,
+ void *buf,
+ size_t len)
+{
+ struct wcn36xx_hal_delete_sta_context_ind_msg *rsp = buf;
+ struct ieee80211_vif *vif = container_of((void *)wcn->current_vif,
+ struct ieee80211_vif,
+ drv_priv);
+ struct ieee80211_sta *sta;
+ if (len != sizeof(*rsp)) {
+ wcn36xx_warn("Bad delete sta indication");
+ return -EIO;
+ }
+
+ rcu_read_lock();
+ sta = ieee80211_find_sta(vif, rsp->addr2);
+ if (sta) {
+ wcn36xx_dbg(WCN36XX_DBG_HAL,
+ "delete station indication %pM", rsp->addr2);
+ ieee80211_report_low_ack(sta, 0);
+ }
+ rcu_read_unlock();
+ return 0;
+}
static void wcn36xx_smd_rsp_process(struct wcn36xx *wcn, void *buf, size_t len)
{
struct wcn36xx_hal_msg_header *msg_header = buf;
@@ -1447,6 +1471,9 @@ static void wcn36xx_smd_rsp_process(struct wcn36xx *wcn, void *buf, size_t len)
case WCN36XX_HAL_FEATURE_CAPS_EXCHANGE_RSP:
wcn36xx_smd_feature_caps_exchange_rsp(buf, len);
break;
+ case WCN36XX_HAL_DELETE_STA_CONTEXT_IND:
+ wcn36xx_smd_delete_sta_context_ind(wcn, buf, len);
+ break;
default:
wcn36xx_error("SMD_EVENT (%d) not supported", msg_header->msg_type);
}
--
1.8.2.2
More information about the wcn36xx
mailing list