Commit 25a44da2 authored by Pontus Fuchs's avatar Pontus Fuchs Committed by Kalle Valo

wcn36xx: Remove sta pointer in private vif struct

This does not work with multiple sta's in a vif.
Signed-off-by: default avatarPontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent 81c69263
...@@ -796,7 +796,6 @@ static int wcn36xx_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ...@@ -796,7 +796,6 @@ static int wcn36xx_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
vif, sta->addr); vif, sta->addr);
spin_lock_init(&sta_priv->ampdu_lock); spin_lock_init(&sta_priv->ampdu_lock);
vif_priv->sta = sta_priv;
sta_priv->vif = vif_priv; sta_priv->vif = vif_priv;
/* /*
* For STA mode HW will be configured on BSS_CHANGED_ASSOC because * For STA mode HW will be configured on BSS_CHANGED_ASSOC because
...@@ -815,14 +814,12 @@ static int wcn36xx_sta_remove(struct ieee80211_hw *hw, ...@@ -815,14 +814,12 @@ static int wcn36xx_sta_remove(struct ieee80211_hw *hw,
struct ieee80211_sta *sta) struct ieee80211_sta *sta)
{ {
struct wcn36xx *wcn = hw->priv; struct wcn36xx *wcn = hw->priv;
struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif);
struct wcn36xx_sta *sta_priv = wcn36xx_sta_to_priv(sta); struct wcn36xx_sta *sta_priv = wcn36xx_sta_to_priv(sta);
wcn36xx_dbg(WCN36XX_DBG_MAC, "mac sta remove vif %p sta %pM index %d\n", wcn36xx_dbg(WCN36XX_DBG_MAC, "mac sta remove vif %p sta %pM index %d\n",
vif, sta->addr, sta_priv->sta_index); vif, sta->addr, sta_priv->sta_index);
wcn36xx_smd_delete_sta(wcn, sta_priv->sta_index); wcn36xx_smd_delete_sta(wcn, sta_priv->sta_index);
vif_priv->sta = NULL;
sta_priv->vif = NULL; sta_priv->vif = NULL;
return 0; return 0;
} }
......
...@@ -1170,6 +1170,7 @@ static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, ...@@ -1170,6 +1170,7 @@ static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn,
static int wcn36xx_smd_config_bss_rsp(struct wcn36xx *wcn, static int wcn36xx_smd_config_bss_rsp(struct wcn36xx *wcn,
struct ieee80211_vif *vif, struct ieee80211_vif *vif,
struct ieee80211_sta *sta,
void *buf, void *buf,
size_t len) size_t len)
{ {
...@@ -1200,9 +1201,10 @@ static int wcn36xx_smd_config_bss_rsp(struct wcn36xx *wcn, ...@@ -1200,9 +1201,10 @@ static int wcn36xx_smd_config_bss_rsp(struct wcn36xx *wcn,
vif_priv->bss_index = params->bss_index; vif_priv->bss_index = params->bss_index;
if (vif_priv->sta) { if (sta) {
vif_priv->sta->bss_sta_index = params->bss_sta_index; struct wcn36xx_sta *sta_priv = wcn36xx_sta_to_priv(sta);
vif_priv->sta->bss_dpu_desc_index = params->dpu_desc_index; sta_priv->bss_sta_index = params->bss_sta_index;
sta_priv->bss_dpu_desc_index = params->dpu_desc_index;
} }
vif_priv->self_ucast_dpu_sign = params->ucast_dpu_signature; vif_priv->self_ucast_dpu_sign = params->ucast_dpu_signature;
...@@ -1329,6 +1331,7 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif, ...@@ -1329,6 +1331,7 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif,
} }
ret = wcn36xx_smd_config_bss_rsp(wcn, ret = wcn36xx_smd_config_bss_rsp(wcn,
vif, vif,
sta,
wcn->hal_buf, wcn->hal_buf,
wcn->hal_rsp_len); wcn->hal_rsp_len);
if (ret) { if (ret) {
...@@ -2058,25 +2061,24 @@ static int wcn36xx_smd_delete_sta_context_ind(struct wcn36xx *wcn, ...@@ -2058,25 +2061,24 @@ static int wcn36xx_smd_delete_sta_context_ind(struct wcn36xx *wcn,
{ {
struct wcn36xx_hal_delete_sta_context_ind_msg *rsp = buf; struct wcn36xx_hal_delete_sta_context_ind_msg *rsp = buf;
struct wcn36xx_vif *tmp; struct wcn36xx_vif *tmp;
struct ieee80211_sta *sta = NULL; struct ieee80211_sta *sta;
if (len != sizeof(*rsp)) { if (len != sizeof(*rsp)) {
wcn36xx_warn("Corrupted delete sta indication\n"); wcn36xx_warn("Corrupted delete sta indication\n");
return -EIO; return -EIO;
} }
wcn36xx_dbg(WCN36XX_DBG_HAL, "delete station indication %pM index %d\n",
rsp->addr2, rsp->sta_id);
list_for_each_entry(tmp, &wcn->vif_list, list) { list_for_each_entry(tmp, &wcn->vif_list, list) {
if (sta && (tmp->sta->sta_index == rsp->sta_id)) { rcu_read_lock();
sta = container_of((void *)tmp->sta, sta = ieee80211_find_sta(wcn36xx_priv_to_vif(tmp), rsp->addr2);
struct ieee80211_sta, if (sta)
drv_priv);
wcn36xx_dbg(WCN36XX_DBG_HAL,
"delete station indication %pM index %d\n",
rsp->addr2,
rsp->sta_id);
ieee80211_report_low_ack(sta, 0); ieee80211_report_low_ack(sta, 0);
rcu_read_unlock();
if (sta)
return 0; return 0;
}
} }
wcn36xx_warn("STA with addr %pM and index %d not found\n", wcn36xx_warn("STA with addr %pM and index %d not found\n",
......
...@@ -125,7 +125,6 @@ struct wcn36xx_platform_ctrl_ops { ...@@ -125,7 +125,6 @@ struct wcn36xx_platform_ctrl_ops {
*/ */
struct wcn36xx_vif { struct wcn36xx_vif {
struct list_head list; struct list_head list;
struct wcn36xx_sta *sta;
u8 dtim_period; u8 dtim_period;
enum ani_ed_type encrypt_type; enum ani_ed_type encrypt_type;
bool is_joining; bool is_joining;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment