aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/wcn36xx
diff options
context:
space:
mode:
authorPontus Fuchs <pontus.fuchs@gmail.com>2016-04-19 01:00:46 -0400
committerKalle Valo <kvalo@qca.qualcomm.com>2016-04-25 13:37:05 -0400
commit25a44da26f2901308440a047b27a3a0054ea4a71 (patch)
tree09ad091f4128bec5686a3c718fbe318a3acd8480 /drivers/net/wireless/ath/wcn36xx
parent81c69263757788d77537fefdd9a55b05ed83c87b (diff)
wcn36xx: Remove sta pointer in private vif struct
This does not work with multiple sta's in a vif. Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/wcn36xx')
-rw-r--r--drivers/net/wireless/ath/wcn36xx/main.c3
-rw-r--r--drivers/net/wireless/ath/wcn36xx/smd.c28
-rw-r--r--drivers/net/wireless/ath/wcn36xx/wcn36xx.h1
3 files changed, 15 insertions, 17 deletions
diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
index a23738deb5b3..7c06ca9fdd2c 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -796,7 +796,6 @@ static int wcn36xx_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
796 vif, sta->addr); 796 vif, sta->addr);
797 797
798 spin_lock_init(&sta_priv->ampdu_lock); 798 spin_lock_init(&sta_priv->ampdu_lock);
799 vif_priv->sta = sta_priv;
800 sta_priv->vif = vif_priv; 799 sta_priv->vif = vif_priv;
801 /* 800 /*
802 * For STA mode HW will be configured on BSS_CHANGED_ASSOC because 801 * 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 struct ieee80211_sta *sta) 814 struct ieee80211_sta *sta)
816{ 815{
817 struct wcn36xx *wcn = hw->priv; 816 struct wcn36xx *wcn = hw->priv;
818 struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif);
819 struct wcn36xx_sta *sta_priv = wcn36xx_sta_to_priv(sta); 817 struct wcn36xx_sta *sta_priv = wcn36xx_sta_to_priv(sta);
820 818
821 wcn36xx_dbg(WCN36XX_DBG_MAC, "mac sta remove vif %p sta %pM index %d\n", 819 wcn36xx_dbg(WCN36XX_DBG_MAC, "mac sta remove vif %p sta %pM index %d\n",
822 vif, sta->addr, sta_priv->sta_index); 820 vif, sta->addr, sta_priv->sta_index);
823 821
824 wcn36xx_smd_delete_sta(wcn, sta_priv->sta_index); 822 wcn36xx_smd_delete_sta(wcn, sta_priv->sta_index);
825 vif_priv->sta = NULL;
826 sta_priv->vif = NULL; 823 sta_priv->vif = NULL;
827 return 0; 824 return 0;
828} 825}
diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index ff56138528b6..76c6856ed932 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -1170,6 +1170,7 @@ static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn,
1170 1170
1171static int wcn36xx_smd_config_bss_rsp(struct wcn36xx *wcn, 1171static int wcn36xx_smd_config_bss_rsp(struct wcn36xx *wcn,
1172 struct ieee80211_vif *vif, 1172 struct ieee80211_vif *vif,
1173 struct ieee80211_sta *sta,
1173 void *buf, 1174 void *buf,
1174 size_t len) 1175 size_t len)
1175{ 1176{
@@ -1200,9 +1201,10 @@ static int wcn36xx_smd_config_bss_rsp(struct wcn36xx *wcn,
1200 1201
1201 vif_priv->bss_index = params->bss_index; 1202 vif_priv->bss_index = params->bss_index;
1202 1203
1203 if (vif_priv->sta) { 1204 if (sta) {
1204 vif_priv->sta->bss_sta_index = params->bss_sta_index; 1205 struct wcn36xx_sta *sta_priv = wcn36xx_sta_to_priv(sta);
1205 vif_priv->sta->bss_dpu_desc_index = params->dpu_desc_index; 1206 sta_priv->bss_sta_index = params->bss_sta_index;
1207 sta_priv->bss_dpu_desc_index = params->dpu_desc_index;
1206 } 1208 }
1207 1209
1208 vif_priv->self_ucast_dpu_sign = params->ucast_dpu_signature; 1210 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 } 1331 }
1330 ret = wcn36xx_smd_config_bss_rsp(wcn, 1332 ret = wcn36xx_smd_config_bss_rsp(wcn,
1331 vif, 1333 vif,
1334 sta,
1332 wcn->hal_buf, 1335 wcn->hal_buf,
1333 wcn->hal_rsp_len); 1336 wcn->hal_rsp_len);
1334 if (ret) { 1337 if (ret) {
@@ -2058,25 +2061,24 @@ static int wcn36xx_smd_delete_sta_context_ind(struct wcn36xx *wcn,
2058{ 2061{
2059 struct wcn36xx_hal_delete_sta_context_ind_msg *rsp = buf; 2062 struct wcn36xx_hal_delete_sta_context_ind_msg *rsp = buf;
2060 struct wcn36xx_vif *tmp; 2063 struct wcn36xx_vif *tmp;
2061 struct ieee80211_sta *sta = NULL; 2064 struct ieee80211_sta *sta;
2062 2065
2063 if (len != sizeof(*rsp)) { 2066 if (len != sizeof(*rsp)) {
2064 wcn36xx_warn("Corrupted delete sta indication\n"); 2067 wcn36xx_warn("Corrupted delete sta indication\n");
2065 return -EIO; 2068 return -EIO;
2066 } 2069 }
2067 2070
2071 wcn36xx_dbg(WCN36XX_DBG_HAL, "delete station indication %pM index %d\n",
2072 rsp->addr2, rsp->sta_id);
2073
2068 list_for_each_entry(tmp, &wcn->vif_list, list) { 2074 list_for_each_entry(tmp, &wcn->vif_list, list) {
2069 if (sta && (tmp->sta->sta_index == rsp->sta_id)) { 2075 rcu_read_lock();
2070 sta = container_of((void *)tmp->sta, 2076 sta = ieee80211_find_sta(wcn36xx_priv_to_vif(tmp), rsp->addr2);
2071 struct ieee80211_sta, 2077 if (sta)
2072 drv_priv);
2073 wcn36xx_dbg(WCN36XX_DBG_HAL,
2074 "delete station indication %pM index %d\n",
2075 rsp->addr2,
2076 rsp->sta_id);
2077 ieee80211_report_low_ack(sta, 0); 2078 ieee80211_report_low_ack(sta, 0);
2079 rcu_read_unlock();
2080 if (sta)
2078 return 0; 2081 return 0;
2079 }
2080 } 2082 }
2081 2083
2082 wcn36xx_warn("STA with addr %pM and index %d not found\n", 2084 wcn36xx_warn("STA with addr %pM and index %d not found\n",
diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
index c368a34c8de7..54000db0af1a 100644
--- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
+++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
@@ -125,7 +125,6 @@ struct wcn36xx_platform_ctrl_ops {
125 */ 125 */
126struct wcn36xx_vif { 126struct wcn36xx_vif {
127 struct list_head list; 127 struct list_head list;
128 struct wcn36xx_sta *sta;
129 u8 dtim_period; 128 u8 dtim_period;
130 enum ani_ed_type encrypt_type; 129 enum ani_ed_type encrypt_type;
131 bool is_joining; 130 bool is_joining;