aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/ath/ath9k/recv.c3
-rw-r--r--drivers/net/wireless/ath/ath9k/xmit.c3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-rs.c3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sta.c2
-rw-r--r--include/net/mac80211.h25
-rw-r--r--net/mac80211/sta_info.c18
7 files changed, 47 insertions, 9 deletions
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index c880a55939bf..355dd1834e1d 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -202,7 +202,8 @@ static int ath_rx_prepare(struct sk_buff *skb, struct ath_desc *ds,
202 } 202 }
203 203
204 rcu_read_lock(); 204 rcu_read_lock();
205 sta = ieee80211_find_sta(sc->hw, hdr->addr2); 205 /* XXX: use ieee80211_find_sta! */
206 sta = ieee80211_find_sta_by_hw(sc->hw, hdr->addr2);
206 if (sta) { 207 if (sta) {
207 an = (struct ath_node *) sta->drv_priv; 208 an = (struct ath_node *) sta->drv_priv;
208 if (ds->ds_rxstat.rs_rssi != ATH9K_RSSI_BAD && 209 if (ds->ds_rxstat.rs_rssi != ATH9K_RSSI_BAD &&
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 2a4efcbced60..8e052f406c35 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -282,7 +282,8 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
282 282
283 rcu_read_lock(); 283 rcu_read_lock();
284 284
285 sta = ieee80211_find_sta(sc->hw, hdr->addr1); 285 /* XXX: use ieee80211_find_sta! */
286 sta = ieee80211_find_sta_by_hw(sc->hw, hdr->addr1);
286 if (!sta) { 287 if (!sta) {
287 rcu_read_unlock(); 288 rcu_read_unlock();
288 return; 289 return;
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
index 819a81bbb1b7..dc81e19674f7 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
@@ -913,7 +913,8 @@ void iwl3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id)
913 913
914 rcu_read_lock(); 914 rcu_read_lock();
915 915
916 sta = ieee80211_find_sta(hw, priv->stations[sta_id].sta.sta.addr); 916 sta = ieee80211_find_sta(priv->vif,
917 priv->stations[sta_id].sta.sta.addr);
917 if (!sta) { 918 if (!sta) {
918 rcu_read_unlock(); 919 rcu_read_unlock();
919 return; 920 return;
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 7373b2f50aca..e0b5b4aef41d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -2300,7 +2300,7 @@ static void iwl_ht_conf(struct iwl_priv *priv,
2300 switch (priv->iw_mode) { 2300 switch (priv->iw_mode) {
2301 case NL80211_IFTYPE_STATION: 2301 case NL80211_IFTYPE_STATION:
2302 rcu_read_lock(); 2302 rcu_read_lock();
2303 sta = ieee80211_find_sta(priv->hw, priv->bssid); 2303 sta = ieee80211_find_sta(priv->vif, priv->bssid);
2304 if (sta) { 2304 if (sta) {
2305 struct ieee80211_sta_ht_cap *ht_cap = &sta->ht_cap; 2305 struct ieee80211_sta_ht_cap *ht_cap = &sta->ht_cap;
2306 int maxstreams; 2306 int maxstreams;
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c
index 74cc8dbe9359..eba36f737388 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.c
@@ -1017,7 +1017,7 @@ int iwl_rxon_add_station(struct iwl_priv *priv, const u8 *addr, bool is_ap)
1017 */ 1017 */
1018 if (priv->current_ht_config.is_ht) { 1018 if (priv->current_ht_config.is_ht) {
1019 rcu_read_lock(); 1019 rcu_read_lock();
1020 sta = ieee80211_find_sta(priv->hw, addr); 1020 sta = ieee80211_find_sta(priv->vif, addr);
1021 if (sta) { 1021 if (sta) {
1022 memcpy(&ht_config, &sta->ht_cap, sizeof(ht_config)); 1022 memcpy(&ht_config, &sta->ht_cap, sizeof(ht_config));
1023 cur_ht_config = &ht_config; 1023 cur_ht_config = &ht_config;
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index e12293e60ac1..7f035d779db9 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -2106,16 +2106,37 @@ void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra,
2106/** 2106/**
2107 * ieee80211_find_sta - find a station 2107 * ieee80211_find_sta - find a station
2108 * 2108 *
2109 * @hw: pointer as obtained from ieee80211_alloc_hw() 2109 * @vif: virtual interface to look for station on
2110 * @addr: station's address 2110 * @addr: station's address
2111 * 2111 *
2112 * This function must be called under RCU lock and the 2112 * This function must be called under RCU lock and the
2113 * resulting pointer is only valid under RCU lock as well. 2113 * resulting pointer is only valid under RCU lock as well.
2114 */ 2114 */
2115struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_hw *hw, 2115struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_vif *vif,
2116 const u8 *addr); 2116 const u8 *addr);
2117 2117
2118/** 2118/**
2119 * ieee80211_find_sta_by_hw - find a station on hardware
2120 *
2121 * @hw: pointer as obtained from ieee80211_alloc_hw()
2122 * @addr: station's address
2123 *
2124 * This function must be called under RCU lock and the
2125 * resulting pointer is only valid under RCU lock as well.
2126 *
2127 * NOTE: This function should not be used! When mac80211 is converted
2128 * internally to properly keep track of stations on multiple
2129 * virtual interfaces, it will not always know which station to
2130 * return here since a single address might be used by multiple
2131 * logical stations (e.g. consider a station connecting to another
2132 * BSSID on the same AP hardware without disconnecting first).
2133 *
2134 * DO NOT USE THIS FUNCTION.
2135 */
2136struct ieee80211_sta *ieee80211_find_sta_by_hw(struct ieee80211_hw *hw,
2137 const u8 *addr);
2138
2139/**
2119 * ieee80211_beacon_loss - inform hardware does not receive beacons 2140 * ieee80211_beacon_loss - inform hardware does not receive beacons
2120 * 2141 *
2121 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 2142 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 594f2318c3d8..cde2da7a74df 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -801,8 +801,8 @@ void ieee80211_sta_expire(struct ieee80211_sub_if_data *sdata,
801 sta_info_destroy(sta); 801 sta_info_destroy(sta);
802} 802}
803 803
804struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_hw *hw, 804struct ieee80211_sta *ieee80211_find_sta_by_hw(struct ieee80211_hw *hw,
805 const u8 *addr) 805 const u8 *addr)
806{ 806{
807 struct sta_info *sta = sta_info_get(hw_to_local(hw), addr); 807 struct sta_info *sta = sta_info_get(hw_to_local(hw), addr);
808 808
@@ -810,4 +810,18 @@ struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_hw *hw,
810 return NULL; 810 return NULL;
811 return &sta->sta; 811 return &sta->sta;
812} 812}
813EXPORT_SYMBOL_GPL(ieee80211_find_sta_by_hw);
814
815struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_vif *vif,
816 const u8 *addr)
817{
818 struct ieee80211_sub_if_data *sdata;
819
820 if (!vif)
821 return NULL;
822
823 sdata = vif_to_sdata(vif);
824
825 return ieee80211_find_sta_by_hw(&sdata->local->hw, addr);
826}
813EXPORT_SYMBOL(ieee80211_find_sta); 827EXPORT_SYMBOL(ieee80211_find_sta);