aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-09-10 18:02:02 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-09-15 16:48:23 -0400
commit17741cdc264e4d768167766a252210e201c1519a (patch)
tree72c0e697af29a40c03bce002b529c3951d34a3b7
parent8aa21e6fd703cb3fed66ac07dcbcb861f00cf6d6 (diff)
mac80211: share STA information with driver
This patch changes mac80211 to share some more data about stations with drivers. Should help iwlwifi and ath9k when they get around to updating, and might also help with implementing rate control algorithms without internals. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Cc: Sujith Manoharan <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath9k/main.c30
-rw-r--r--drivers/net/wireless/b43/main.c5
-rw-r--r--drivers/net/wireless/b43legacy/main.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.c12
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c12
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c3
-rw-r--r--include/net/mac80211.h53
-rw-r--r--net/mac80211/cfg.c12
-rw-r--r--net/mac80211/debugfs_key.c3
-rw-r--r--net/mac80211/debugfs_sta.c6
-rw-r--r--net/mac80211/ht.c22
-rw-r--r--net/mac80211/iface.c3
-rw-r--r--net/mac80211/key.c2
-rw-r--r--net/mac80211/mesh_hwmp.c8
-rw-r--r--net/mac80211/mesh_plink.c44
-rw-r--r--net/mac80211/mlme.c5
-rw-r--r--net/mac80211/rx.c12
-rw-r--r--net/mac80211/sta_info.c59
-rw-r--r--net/mac80211/sta_info.h7
-rw-r--r--net/mac80211/tkip.c2
-rw-r--r--net/mac80211/tx.c10
-rw-r--r--net/mac80211/wme.c2
-rw-r--r--net/mac80211/wpa.c2
23 files changed, 189 insertions, 127 deletions
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c
index 2a6e089062f3..1ba18006f475 100644
--- a/drivers/net/wireless/ath9k/main.c
+++ b/drivers/net/wireless/ath9k/main.c
@@ -1405,7 +1405,7 @@ static void ath9k_configure_filter(struct ieee80211_hw *hw,
1405static void ath9k_sta_notify(struct ieee80211_hw *hw, 1405static void ath9k_sta_notify(struct ieee80211_hw *hw,
1406 struct ieee80211_vif *vif, 1406 struct ieee80211_vif *vif,
1407 enum sta_notify_cmd cmd, 1407 enum sta_notify_cmd cmd,
1408 const u8 *addr) 1408 struct ieee80211_sta *sta)
1409{ 1409{
1410 struct ath_softc *sc = hw->priv; 1410 struct ath_softc *sc = hw->priv;
1411 struct ath_node *an; 1411 struct ath_node *an;
@@ -1413,19 +1413,18 @@ static void ath9k_sta_notify(struct ieee80211_hw *hw,
1413 DECLARE_MAC_BUF(mac); 1413 DECLARE_MAC_BUF(mac);
1414 1414
1415 spin_lock_irqsave(&sc->node_lock, flags); 1415 spin_lock_irqsave(&sc->node_lock, flags);
1416 an = ath_node_find(sc, (u8 *) addr); 1416 an = ath_node_find(sc, sta->addr);
1417 spin_unlock_irqrestore(&sc->node_lock, flags); 1417 spin_unlock_irqrestore(&sc->node_lock, flags);
1418 1418
1419 switch (cmd) { 1419 switch (cmd) {
1420 case STA_NOTIFY_ADD: 1420 case STA_NOTIFY_ADD:
1421 spin_lock_irqsave(&sc->node_lock, flags); 1421 spin_lock_irqsave(&sc->node_lock, flags);
1422 if (!an) { 1422 if (!an) {
1423 ath_node_attach(sc, (u8 *)addr, 0); 1423 ath_node_attach(sc, sta->addr, 0);
1424 DPRINTF(sc, ATH_DBG_CONFIG, "%s: Attach a node: %s\n", 1424 DPRINTF(sc, ATH_DBG_CONFIG, "%s: Attach a node: %s\n",
1425 __func__, 1425 __func__, print_mac(mac, sta->addr));
1426 print_mac(mac, addr));
1427 } else { 1426 } else {
1428 ath_node_get(sc, (u8 *)addr); 1427 ath_node_get(sc, sta->addr);
1429 } 1428 }
1430 spin_unlock_irqrestore(&sc->node_lock, flags); 1429 spin_unlock_irqrestore(&sc->node_lock, flags);
1431 break; 1430 break;
@@ -1438,7 +1437,7 @@ static void ath9k_sta_notify(struct ieee80211_hw *hw,
1438 ath_node_put(sc, an, ATH9K_BH_STATUS_INTACT); 1437 ath_node_put(sc, an, ATH9K_BH_STATUS_INTACT);
1439 DPRINTF(sc, ATH_DBG_CONFIG, "%s: Put a node: %s\n", 1438 DPRINTF(sc, ATH_DBG_CONFIG, "%s: Put a node: %s\n",
1440 __func__, 1439 __func__,
1441 print_mac(mac, addr)); 1440 print_mac(mac, sta->addr));
1442 } 1441 }
1443 break; 1442 break;
1444 default: 1443 default:
@@ -1581,45 +1580,44 @@ static void ath9k_reset_tsf(struct ieee80211_hw *hw)
1581 1580
1582static int ath9k_ampdu_action(struct ieee80211_hw *hw, 1581static int ath9k_ampdu_action(struct ieee80211_hw *hw,
1583 enum ieee80211_ampdu_mlme_action action, 1582 enum ieee80211_ampdu_mlme_action action,
1584 const u8 *addr, 1583 struct ieee80211_sta *sta,
1585 u16 tid, 1584 u16 tid, u16 *ssn)
1586 u16 *ssn)
1587{ 1585{
1588 struct ath_softc *sc = hw->priv; 1586 struct ath_softc *sc = hw->priv;
1589 int ret = 0; 1587 int ret = 0;
1590 1588
1591 switch (action) { 1589 switch (action) {
1592 case IEEE80211_AMPDU_RX_START: 1590 case IEEE80211_AMPDU_RX_START:
1593 ret = ath_rx_aggr_start(sc, addr, tid, ssn); 1591 ret = ath_rx_aggr_start(sc, sta->addr, tid, ssn);
1594 if (ret < 0) 1592 if (ret < 0)
1595 DPRINTF(sc, ATH_DBG_FATAL, 1593 DPRINTF(sc, ATH_DBG_FATAL,
1596 "%s: Unable to start RX aggregation\n", 1594 "%s: Unable to start RX aggregation\n",
1597 __func__); 1595 __func__);
1598 break; 1596 break;
1599 case IEEE80211_AMPDU_RX_STOP: 1597 case IEEE80211_AMPDU_RX_STOP:
1600 ret = ath_rx_aggr_stop(sc, addr, tid); 1598 ret = ath_rx_aggr_stop(sc, sta->addr, tid);
1601 if (ret < 0) 1599 if (ret < 0)
1602 DPRINTF(sc, ATH_DBG_FATAL, 1600 DPRINTF(sc, ATH_DBG_FATAL,
1603 "%s: Unable to stop RX aggregation\n", 1601 "%s: Unable to stop RX aggregation\n",
1604 __func__); 1602 __func__);
1605 break; 1603 break;
1606 case IEEE80211_AMPDU_TX_START: 1604 case IEEE80211_AMPDU_TX_START:
1607 ret = ath_tx_aggr_start(sc, addr, tid, ssn); 1605 ret = ath_tx_aggr_start(sc, sta->addr, tid, ssn);
1608 if (ret < 0) 1606 if (ret < 0)
1609 DPRINTF(sc, ATH_DBG_FATAL, 1607 DPRINTF(sc, ATH_DBG_FATAL,
1610 "%s: Unable to start TX aggregation\n", 1608 "%s: Unable to start TX aggregation\n",
1611 __func__); 1609 __func__);
1612 else 1610 else
1613 ieee80211_start_tx_ba_cb_irqsafe(hw, (u8 *)addr, tid); 1611 ieee80211_start_tx_ba_cb_irqsafe(hw, sta->addr, tid);
1614 break; 1612 break;
1615 case IEEE80211_AMPDU_TX_STOP: 1613 case IEEE80211_AMPDU_TX_STOP:
1616 ret = ath_tx_aggr_stop(sc, addr, tid); 1614 ret = ath_tx_aggr_stop(sc, sta->addr, tid);
1617 if (ret < 0) 1615 if (ret < 0)
1618 DPRINTF(sc, ATH_DBG_FATAL, 1616 DPRINTF(sc, ATH_DBG_FATAL,
1619 "%s: Unable to stop TX aggregation\n", 1617 "%s: Unable to stop TX aggregation\n",
1620 __func__); 1618 __func__);
1621 1619
1622 ieee80211_stop_tx_ba_cb_irqsafe(hw, (u8 *)addr, tid); 1620 ieee80211_stop_tx_ba_cb_irqsafe(hw, sta->addr, tid);
1623 break; 1621 break;
1624 default: 1622 default:
1625 DPRINTF(sc, ATH_DBG_FATAL, 1623 DPRINTF(sc, ATH_DBG_FATAL,
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index df7a1e7f4a52..0f628a29d833 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -4234,7 +4234,8 @@ out_unlock:
4234 return err; 4234 return err;
4235} 4235}
4236 4236
4237static int b43_op_beacon_set_tim(struct ieee80211_hw *hw, int aid, int set) 4237static int b43_op_beacon_set_tim(struct ieee80211_hw *hw,
4238 struct ieee80211_sta *sta, bool set)
4238{ 4239{
4239 struct b43_wl *wl = hw_to_b43_wl(hw); 4240 struct b43_wl *wl = hw_to_b43_wl(hw);
4240 unsigned long flags; 4241 unsigned long flags;
@@ -4249,7 +4250,7 @@ static int b43_op_beacon_set_tim(struct ieee80211_hw *hw, int aid, int set)
4249static void b43_op_sta_notify(struct ieee80211_hw *hw, 4250static void b43_op_sta_notify(struct ieee80211_hw *hw,
4250 struct ieee80211_vif *vif, 4251 struct ieee80211_vif *vif,
4251 enum sta_notify_cmd notify_cmd, 4252 enum sta_notify_cmd notify_cmd,
4252 const u8 *addr) 4253 struct ieee80211_sta *sta)
4253{ 4254{
4254 struct b43_wl *wl = hw_to_b43_wl(hw); 4255 struct b43_wl *wl = hw_to_b43_wl(hw);
4255 4256
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index 6e425410c99d..9fb1421cbec2 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -3403,7 +3403,7 @@ out_unlock:
3403} 3403}
3404 3404
3405static int b43legacy_op_beacon_set_tim(struct ieee80211_hw *hw, 3405static int b43legacy_op_beacon_set_tim(struct ieee80211_hw *hw,
3406 int aid, int set) 3406 struct ieee80211_sta *sta, bool set)
3407{ 3407{
3408 struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); 3408 struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw);
3409 unsigned long flags; 3409 unsigned long flags;
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index 700da67ac288..af4e0b994e42 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -366,8 +366,8 @@ static void rs_tl_turn_on_agg_for_tid(struct iwl_priv *priv,
366 if (state == HT_AGG_STATE_IDLE && 366 if (state == HT_AGG_STATE_IDLE &&
367 rs_tl_get_load(lq_data, tid) > IWL_AGG_LOAD_THRESHOLD) { 367 rs_tl_get_load(lq_data, tid) > IWL_AGG_LOAD_THRESHOLD) {
368 IWL_DEBUG_HT("Starting Tx agg: STA: %s tid: %d\n", 368 IWL_DEBUG_HT("Starting Tx agg: STA: %s tid: %d\n",
369 print_mac(mac, sta->addr), tid); 369 print_mac(mac, sta->sta.addr), tid);
370 ieee80211_start_tx_ba_session(priv->hw, sta->addr, tid); 370 ieee80211_start_tx_ba_session(priv->hw, sta->sta.addr, tid);
371 } 371 }
372} 372}
373 373
@@ -2244,17 +2244,17 @@ static void rs_rate_init(void *priv_rate, void *priv_sta,
2244 2244
2245 lq_sta->ibss_sta_added = 0; 2245 lq_sta->ibss_sta_added = 0;
2246 if (priv->iw_mode == NL80211_IFTYPE_AP) { 2246 if (priv->iw_mode == NL80211_IFTYPE_AP) {
2247 u8 sta_id = iwl_find_station(priv, sta->addr); 2247 u8 sta_id = iwl_find_station(priv, sta->sta.addr);
2248 DECLARE_MAC_BUF(mac); 2248 DECLARE_MAC_BUF(mac);
2249 2249
2250 /* for IBSS the call are from tasklet */ 2250 /* for IBSS the call are from tasklet */
2251 IWL_DEBUG_RATE("LQ: ADD station %s\n", 2251 IWL_DEBUG_RATE("LQ: ADD station %s\n",
2252 print_mac(mac, sta->addr)); 2252 print_mac(mac, sta->sta.addr));
2253 2253
2254 if (sta_id == IWL_INVALID_STATION) { 2254 if (sta_id == IWL_INVALID_STATION) {
2255 IWL_DEBUG_RATE("LQ: ADD station %s\n", 2255 IWL_DEBUG_RATE("LQ: ADD station %s\n",
2256 print_mac(mac, sta->addr)); 2256 print_mac(mac, sta->sta.addr));
2257 sta_id = iwl_add_station_flags(priv, sta->addr, 2257 sta_id = iwl_add_station_flags(priv, sta->sta.addr,
2258 0, CMD_ASYNC, NULL); 2258 0, CMD_ASYNC, NULL);
2259 } 2259 }
2260 if ((sta_id != IWL_INVALID_STATION)) { 2260 if ((sta_id != IWL_INVALID_STATION)) {
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index e8db33bf5e5d..5eeffb41d8c2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -3413,13 +3413,13 @@ static int iwl4965_mac_conf_tx(struct ieee80211_hw *hw, u16 queue,
3413 3413
3414static int iwl4965_mac_ampdu_action(struct ieee80211_hw *hw, 3414static int iwl4965_mac_ampdu_action(struct ieee80211_hw *hw,
3415 enum ieee80211_ampdu_mlme_action action, 3415 enum ieee80211_ampdu_mlme_action action,
3416 const u8 *addr, u16 tid, u16 *ssn) 3416 struct ieee80211_sta *sta, u16 tid, u16 *ssn)
3417{ 3417{
3418 struct iwl_priv *priv = hw->priv; 3418 struct iwl_priv *priv = hw->priv;
3419 DECLARE_MAC_BUF(mac); 3419 DECLARE_MAC_BUF(mac);
3420 3420
3421 IWL_DEBUG_HT("A-MPDU action on addr %s tid %d\n", 3421 IWL_DEBUG_HT("A-MPDU action on addr %s tid %d\n",
3422 print_mac(mac, addr), tid); 3422 print_mac(mac, sta->addr), tid);
3423 3423
3424 if (!(priv->cfg->sku & IWL_SKU_N)) 3424 if (!(priv->cfg->sku & IWL_SKU_N))
3425 return -EACCES; 3425 return -EACCES;
@@ -3427,16 +3427,16 @@ static int iwl4965_mac_ampdu_action(struct ieee80211_hw *hw,
3427 switch (action) { 3427 switch (action) {
3428 case IEEE80211_AMPDU_RX_START: 3428 case IEEE80211_AMPDU_RX_START:
3429 IWL_DEBUG_HT("start Rx\n"); 3429 IWL_DEBUG_HT("start Rx\n");
3430 return iwl_rx_agg_start(priv, addr, tid, *ssn); 3430 return iwl_rx_agg_start(priv, sta->addr, tid, *ssn);
3431 case IEEE80211_AMPDU_RX_STOP: 3431 case IEEE80211_AMPDU_RX_STOP:
3432 IWL_DEBUG_HT("stop Rx\n"); 3432 IWL_DEBUG_HT("stop Rx\n");
3433 return iwl_rx_agg_stop(priv, addr, tid); 3433 return iwl_rx_agg_stop(priv, sta->addr, tid);
3434 case IEEE80211_AMPDU_TX_START: 3434 case IEEE80211_AMPDU_TX_START:
3435 IWL_DEBUG_HT("start Tx\n"); 3435 IWL_DEBUG_HT("start Tx\n");
3436 return iwl_tx_agg_start(priv, addr, tid, ssn); 3436 return iwl_tx_agg_start(priv, sta->addr, tid, ssn);
3437 case IEEE80211_AMPDU_TX_STOP: 3437 case IEEE80211_AMPDU_TX_STOP:
3438 IWL_DEBUG_HT("stop Tx\n"); 3438 IWL_DEBUG_HT("stop Tx\n");
3439 return iwl_tx_agg_stop(priv, addr, tid); 3439 return iwl_tx_agg_stop(priv, sta->addr, tid);
3440 default: 3440 default:
3441 IWL_DEBUG_HT("unknown\n"); 3441 IWL_DEBUG_HT("unknown\n");
3442 return -EINVAL; 3442 return -EINVAL;
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index bdedf10fc86b..173dd5d2c624 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -390,7 +390,8 @@ static void mac80211_hwsim_bss_info_changed(struct ieee80211_hw *hw,
390 390
391static void mac80211_hwsim_sta_notify(struct ieee80211_hw *hw, 391static void mac80211_hwsim_sta_notify(struct ieee80211_hw *hw,
392 struct ieee80211_vif *vif, 392 struct ieee80211_vif *vif,
393 enum sta_notify_cmd cmd, const u8 *addr) 393 enum sta_notify_cmd cmd,
394 struct ieee80211_sta *sta)
394{ 395{
395 hwsim_check_magic(vif); 396 hwsim_check_magic(vif);
396} 397}
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 7f5ea55e00f5..5a6a029da4da 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -300,6 +300,9 @@ enum mac80211_tx_control_flags {
300 * (2) driver internal use (if applicable) 300 * (2) driver internal use (if applicable)
301 * (3) TX status information - driver tells mac80211 what happened 301 * (3) TX status information - driver tells mac80211 what happened
302 * 302 *
303 * The TX control's sta pointer is only valid during the ->tx call,
304 * it may be NULL.
305 *
303 * @flags: transmit info flags, defined above 306 * @flags: transmit info flags, defined above
304 * @band: TBD 307 * @band: TBD
305 * @tx_rate_idx: TBD 308 * @tx_rate_idx: TBD
@@ -329,8 +332,8 @@ struct ieee80211_tx_info {
329 struct { 332 struct {
330 struct ieee80211_vif *vif; 333 struct ieee80211_vif *vif;
331 struct ieee80211_key_conf *hw_key; 334 struct ieee80211_key_conf *hw_key;
335 struct ieee80211_sta *sta;
332 unsigned long jiffies; 336 unsigned long jiffies;
333 u16 aid;
334 s8 rts_cts_rate_idx, alt_retry_rate_idx; 337 s8 rts_cts_rate_idx, alt_retry_rate_idx;
335 u8 retry_limit; 338 u8 retry_limit;
336 u8 icv_len; 339 u8 icv_len;
@@ -652,6 +655,29 @@ enum set_key_cmd {
652}; 655};
653 656
654/** 657/**
658 * struct ieee80211_sta - station table entry
659 *
660 * A station table entry represents a station we are possibly
661 * communicating with. Since stations are RCU-managed in
662 * mac80211, any ieee80211_sta pointer you get access to must
663 * either be protected by rcu_read_lock() explicitly or implicitly,
664 * or you must take good care to not use such a pointer after a
665 * call to your sta_notify callback that removed it.
666 *
667 * @addr: MAC address
668 * @aid: AID we assigned to the station if we're an AP
669 * @drv_priv: data area for driver use, will always be aligned to
670 * sizeof(void *), size is determined in hw information.
671 */
672struct ieee80211_sta {
673 u8 addr[ETH_ALEN];
674 u16 aid;
675
676 /* must be last */
677 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *))));
678};
679
680/**
655 * enum sta_notify_cmd - sta notify command 681 * enum sta_notify_cmd - sta notify command
656 * 682 *
657 * Used with the sta_notify() callback in &struct ieee80211_ops, this 683 * Used with the sta_notify() callback in &struct ieee80211_ops, this
@@ -795,6 +821,8 @@ enum ieee80211_hw_flags {
795 * 821 *
796 * @vif_data_size: size (in bytes) of the drv_priv data area 822 * @vif_data_size: size (in bytes) of the drv_priv data area
797 * within &struct ieee80211_vif. 823 * within &struct ieee80211_vif.
824 * @sta_data_size: size (in bytes) of the drv_priv data area
825 * within &struct ieee80211_sta.
798 */ 826 */
799struct ieee80211_hw { 827struct ieee80211_hw {
800 struct ieee80211_conf conf; 828 struct ieee80211_conf conf;
@@ -806,6 +834,7 @@ struct ieee80211_hw {
806 unsigned int extra_tx_headroom; 834 unsigned int extra_tx_headroom;
807 int channel_change_time; 835 int channel_change_time;
808 int vif_data_size; 836 int vif_data_size;
837 int sta_data_size;
809 u16 queues; 838 u16 queues;
810 u16 ampdu_queues; 839 u16 ampdu_queues;
811 u16 max_listen_interval; 840 u16 max_listen_interval;
@@ -1089,7 +1118,7 @@ enum ieee80211_ampdu_mlme_action {
1089 * This callback must be implemented and atomic. 1118 * This callback must be implemented and atomic.
1090 * 1119 *
1091 * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit 1120 * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit
1092 * must be set or cleared for a given AID. Must be atomic. 1121 * must be set or cleared for a given STA. Must be atomic.
1093 * 1122 *
1094 * @set_key: See the section "Hardware crypto acceleration" 1123 * @set_key: See the section "Hardware crypto acceleration"
1095 * This callback can sleep, and is only called between add_interface 1124 * This callback can sleep, and is only called between add_interface
@@ -1175,7 +1204,8 @@ struct ieee80211_ops {
1175 unsigned int changed_flags, 1204 unsigned int changed_flags,
1176 unsigned int *total_flags, 1205 unsigned int *total_flags,
1177 int mc_count, struct dev_addr_list *mc_list); 1206 int mc_count, struct dev_addr_list *mc_list);
1178 int (*set_tim)(struct ieee80211_hw *hw, int aid, int set); 1207 int (*set_tim)(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
1208 bool set);
1179 int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd, 1209 int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd,
1180 const u8 *local_address, const u8 *address, 1210 const u8 *local_address, const u8 *address,
1181 struct ieee80211_key_conf *key); 1211 struct ieee80211_key_conf *key);
@@ -1192,7 +1222,7 @@ struct ieee80211_ops {
1192 int (*set_retry_limit)(struct ieee80211_hw *hw, 1222 int (*set_retry_limit)(struct ieee80211_hw *hw,
1193 u32 short_retry, u32 long_retr); 1223 u32 short_retry, u32 long_retr);
1194 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1224 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1195 enum sta_notify_cmd, const u8 *addr); 1225 enum sta_notify_cmd, struct ieee80211_sta *sta);
1196 int (*conf_tx)(struct ieee80211_hw *hw, u16 queue, 1226 int (*conf_tx)(struct ieee80211_hw *hw, u16 queue,
1197 const struct ieee80211_tx_queue_params *params); 1227 const struct ieee80211_tx_queue_params *params);
1198 int (*get_tx_stats)(struct ieee80211_hw *hw, 1228 int (*get_tx_stats)(struct ieee80211_hw *hw,
@@ -1202,7 +1232,7 @@ struct ieee80211_ops {
1202 int (*tx_last_beacon)(struct ieee80211_hw *hw); 1232 int (*tx_last_beacon)(struct ieee80211_hw *hw);
1203 int (*ampdu_action)(struct ieee80211_hw *hw, 1233 int (*ampdu_action)(struct ieee80211_hw *hw,
1204 enum ieee80211_ampdu_mlme_action action, 1234 enum ieee80211_ampdu_mlme_action action,
1205 const u8 *addr, u16 tid, u16 *ssn); 1235 struct ieee80211_sta *sta, u16 tid, u16 *ssn);
1206}; 1236};
1207 1237
1208/** 1238/**
@@ -1752,4 +1782,17 @@ void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra,
1752 */ 1782 */
1753void ieee80211_notify_mac(struct ieee80211_hw *hw, 1783void ieee80211_notify_mac(struct ieee80211_hw *hw,
1754 enum ieee80211_notification_types notif_type); 1784 enum ieee80211_notification_types notif_type);
1785
1786/**
1787 * ieee80211_find_sta - find a station
1788 *
1789 * @hw: pointer as obtained from ieee80211_alloc_hw()
1790 * @addr: station's address
1791 *
1792 * This function must be called under RCU lock and the
1793 * resulting pointer is only valid under RCU lock as well.
1794 */
1795struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_hw *hw,
1796 const u8 *addr);
1797
1755#endif /* MAC80211_H */ 1798#endif /* MAC80211_H */
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index d004351050cc..ed5e77ce627b 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -364,7 +364,7 @@ static int ieee80211_dump_station(struct wiphy *wiphy, struct net_device *dev,
364 sta = sta_info_get_by_idx(local, idx, dev); 364 sta = sta_info_get_by_idx(local, idx, dev);
365 if (sta) { 365 if (sta) {
366 ret = 0; 366 ret = 0;
367 memcpy(mac, sta->addr, ETH_ALEN); 367 memcpy(mac, sta->sta.addr, ETH_ALEN);
368 sta_set_sinfo(sta, sinfo); 368 sta_set_sinfo(sta, sinfo);
369 } 369 }
370 370
@@ -593,7 +593,7 @@ static void ieee80211_send_layer2_update(struct sta_info *sta)
593 * Update response frame; IEEE Std 802.2-1998, 5.4.1.2.1 */ 593 * Update response frame; IEEE Std 802.2-1998, 5.4.1.2.1 */
594 594
595 memset(msg->da, 0xff, ETH_ALEN); 595 memset(msg->da, 0xff, ETH_ALEN);
596 memcpy(msg->sa, sta->addr, ETH_ALEN); 596 memcpy(msg->sa, sta->sta.addr, ETH_ALEN);
597 msg->len = htons(6); 597 msg->len = htons(6);
598 msg->dsap = 0; 598 msg->dsap = 0;
599 msg->ssap = 0x01; /* NULL LSAP, CR Bit: Response */ 599 msg->ssap = 0x01; /* NULL LSAP, CR Bit: Response */
@@ -648,9 +648,9 @@ static void sta_apply_parameters(struct ieee80211_local *local,
648 */ 648 */
649 649
650 if (params->aid) { 650 if (params->aid) {
651 sta->aid = params->aid; 651 sta->sta.aid = params->aid;
652 if (sta->aid > IEEE80211_MAX_AID) 652 if (sta->sta.aid > IEEE80211_MAX_AID)
653 sta->aid = 0; /* XXX: should this be an error? */ 653 sta->sta.aid = 0; /* XXX: should this be an error? */
654 } 654 }
655 655
656 if (params->listen_interval >= 0) 656 if (params->listen_interval >= 0)
@@ -919,7 +919,7 @@ static void mpath_set_pinfo(struct mesh_path *mpath, u8 *next_hop,
919 struct mpath_info *pinfo) 919 struct mpath_info *pinfo)
920{ 920{
921 if (mpath->next_hop) 921 if (mpath->next_hop)
922 memcpy(next_hop, mpath->next_hop->addr, ETH_ALEN); 922 memcpy(next_hop, mpath->next_hop->sta.addr, ETH_ALEN);
923 else 923 else
924 memset(next_hop, 0, ETH_ALEN); 924 memset(next_hop, 0, ETH_ALEN);
925 925
diff --git a/net/mac80211/debugfs_key.c b/net/mac80211/debugfs_key.c
index cf82acec913a..a3294d109322 100644
--- a/net/mac80211/debugfs_key.c
+++ b/net/mac80211/debugfs_key.c
@@ -206,7 +206,8 @@ void ieee80211_debugfs_key_add(struct ieee80211_key *key)
206 rcu_read_lock(); 206 rcu_read_lock();
207 sta = rcu_dereference(key->sta); 207 sta = rcu_dereference(key->sta);
208 if (sta) 208 if (sta)
209 sprintf(buf, "../../stations/%s", print_mac(mac, sta->addr)); 209 sprintf(buf, "../../stations/%s",
210 print_mac(mac, sta->sta.addr));
210 rcu_read_unlock(); 211 rcu_read_unlock();
211 212
212 /* using sta as a boolean is fine outside RCU lock */ 213 /* using sta as a boolean is fine outside RCU lock */
diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c
index 6abe5427752b..81f350eaf8a3 100644
--- a/net/mac80211/debugfs_sta.c
+++ b/net/mac80211/debugfs_sta.c
@@ -50,7 +50,7 @@ static const struct file_operations sta_ ##name## _ops = { \
50 STA_READ_##format(name, field) \ 50 STA_READ_##format(name, field) \
51 STA_OPS(name) 51 STA_OPS(name)
52 52
53STA_FILE(aid, aid, D); 53STA_FILE(aid, sta.aid, D);
54STA_FILE(dev, sdata->dev->name, S); 54STA_FILE(dev, sdata->dev->name, S);
55STA_FILE(rx_packets, rx_packets, LU); 55STA_FILE(rx_packets, rx_packets, LU);
56STA_FILE(tx_packets, tx_packets, LU); 56STA_FILE(tx_packets, tx_packets, LU);
@@ -176,7 +176,7 @@ static ssize_t sta_agg_status_write(struct file *file,
176 struct net_device *dev = sta->sdata->dev; 176 struct net_device *dev = sta->sdata->dev;
177 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); 177 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
178 struct ieee80211_hw *hw = &local->hw; 178 struct ieee80211_hw *hw = &local->hw;
179 u8 *da = sta->addr; 179 u8 *da = sta->sta.addr;
180 static int tid_static_tx[16] = {0, 0, 0, 0, 0, 0, 0, 0, 180 static int tid_static_tx[16] = {0, 0, 0, 0, 0, 0, 0, 0,
181 0, 0, 0, 0, 0, 0, 0, 0}; 181 0, 0, 0, 0, 0, 0, 0, 0};
182 static int tid_static_rx[16] = {1, 1, 1, 1, 1, 1, 1, 1, 182 static int tid_static_rx[16] = {1, 1, 1, 1, 1, 1, 1, 1,
@@ -253,7 +253,7 @@ void ieee80211_sta_debugfs_add(struct sta_info *sta)
253 if (!stations_dir) 253 if (!stations_dir)
254 return; 254 return;
255 255
256 mac = print_mac(mbuf, sta->addr); 256 mac = print_mac(mbuf, sta->sta.addr);
257 257
258 sta->debugfs.dir = debugfs_create_dir(mac, stations_dir); 258 sta->debugfs.dir = debugfs_create_dir(mac, stations_dir);
259 if (!sta->debugfs.dir) 259 if (!sta->debugfs.dir)
diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c
index bc3c71ad7ae3..dc7d9a3d70d5 100644
--- a/net/mac80211/ht.c
+++ b/net/mac80211/ht.c
@@ -274,7 +274,7 @@ void ieee80211_sta_stop_rx_ba_session(struct ieee80211_sub_if_data *sdata, u8 *r
274#endif /* CONFIG_MAC80211_HT_DEBUG */ 274#endif /* CONFIG_MAC80211_HT_DEBUG */
275 275
276 ret = local->ops->ampdu_action(hw, IEEE80211_AMPDU_RX_STOP, 276 ret = local->ops->ampdu_action(hw, IEEE80211_AMPDU_RX_STOP,
277 ra, tid, NULL); 277 &sta->sta, tid, NULL);
278 if (ret) 278 if (ret)
279 printk(KERN_DEBUG "HW problem - can not stop rx " 279 printk(KERN_DEBUG "HW problem - can not stop rx "
280 "aggregation for tid %d\n", tid); 280 "aggregation for tid %d\n", tid);
@@ -328,7 +328,7 @@ static void sta_addba_resp_timer_expired(unsigned long data)
328 328
329 rcu_read_lock(); 329 rcu_read_lock();
330 330
331 sta = sta_info_get(local, temp_sta->addr); 331 sta = sta_info_get(local, temp_sta->sta.addr);
332 if (!sta) { 332 if (!sta) {
333 rcu_read_unlock(); 333 rcu_read_unlock();
334 return; 334 return;
@@ -354,7 +354,7 @@ static void sta_addba_resp_timer_expired(unsigned long data)
354 /* go through the state check in stop_BA_session */ 354 /* go through the state check in stop_BA_session */
355 *state = HT_AGG_STATE_OPERATIONAL; 355 *state = HT_AGG_STATE_OPERATIONAL;
356 spin_unlock_bh(&sta->lock); 356 spin_unlock_bh(&sta->lock);
357 ieee80211_stop_tx_ba_session(hw, temp_sta->addr, tid, 357 ieee80211_stop_tx_ba_session(hw, temp_sta->sta.addr, tid,
358 WLAN_BACK_INITIATOR); 358 WLAN_BACK_INITIATOR);
359 359
360timer_expired_exit: 360timer_expired_exit:
@@ -465,7 +465,7 @@ int ieee80211_start_tx_ba_session(struct ieee80211_hw *hw, u8 *ra, u16 tid)
465 465
466 if (local->ops->ampdu_action) 466 if (local->ops->ampdu_action)
467 ret = local->ops->ampdu_action(hw, IEEE80211_AMPDU_TX_START, 467 ret = local->ops->ampdu_action(hw, IEEE80211_AMPDU_TX_START,
468 ra, tid, &start_seq_num); 468 &sta->sta, tid, &start_seq_num);
469 469
470 if (ret) { 470 if (ret) {
471 /* No need to requeue the packets in the agg queue, since we 471 /* No need to requeue the packets in the agg queue, since we
@@ -557,7 +557,7 @@ int ieee80211_stop_tx_ba_session(struct ieee80211_hw *hw,
557 557
558 if (local->ops->ampdu_action) 558 if (local->ops->ampdu_action)
559 ret = local->ops->ampdu_action(hw, IEEE80211_AMPDU_TX_STOP, 559 ret = local->ops->ampdu_action(hw, IEEE80211_AMPDU_TX_STOP,
560 ra, tid, NULL); 560 &sta->sta, tid, NULL);
561 561
562 /* case HW denied going back to legacy */ 562 /* case HW denied going back to legacy */
563 if (ret) { 563 if (ret) {
@@ -767,7 +767,7 @@ static void sta_rx_agg_session_timer_expired(unsigned long data)
767#ifdef CONFIG_MAC80211_HT_DEBUG 767#ifdef CONFIG_MAC80211_HT_DEBUG
768 printk(KERN_DEBUG "rx session timer expired on tid %d\n", (u16)*ptid); 768 printk(KERN_DEBUG "rx session timer expired on tid %d\n", (u16)*ptid);
769#endif 769#endif
770 ieee80211_sta_stop_rx_ba_session(sta->sdata, sta->addr, 770 ieee80211_sta_stop_rx_ba_session(sta->sdata, sta->sta.addr,
771 (u16)*ptid, WLAN_BACK_TIMER, 771 (u16)*ptid, WLAN_BACK_TIMER,
772 WLAN_REASON_QSTA_TIMEOUT); 772 WLAN_REASON_QSTA_TIMEOUT);
773} 773}
@@ -874,7 +874,7 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
874 874
875 if (local->ops->ampdu_action) 875 if (local->ops->ampdu_action)
876 ret = local->ops->ampdu_action(hw, IEEE80211_AMPDU_RX_START, 876 ret = local->ops->ampdu_action(hw, IEEE80211_AMPDU_RX_START,
877 sta->addr, tid, &start_seq_num); 877 &sta->sta, tid, &start_seq_num);
878#ifdef CONFIG_MAC80211_HT_DEBUG 878#ifdef CONFIG_MAC80211_HT_DEBUG
879 printk(KERN_DEBUG "Rx A-MPDU request on tid %d result %d\n", tid, ret); 879 printk(KERN_DEBUG "Rx A-MPDU request on tid %d result %d\n", tid, ret);
880#endif /* CONFIG_MAC80211_HT_DEBUG */ 880#endif /* CONFIG_MAC80211_HT_DEBUG */
@@ -899,7 +899,7 @@ end:
899 spin_unlock_bh(&sta->lock); 899 spin_unlock_bh(&sta->lock);
900 900
901end_no_lock: 901end_no_lock:
902 ieee80211_send_addba_resp(sta->sdata, sta->addr, tid, 902 ieee80211_send_addba_resp(sta->sdata, sta->sta.addr, tid,
903 dialog_token, status, 1, buf_size, timeout); 903 dialog_token, status, 1, buf_size, timeout);
904} 904}
905 905
@@ -952,7 +952,7 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local,
952 /* this will allow the state check in stop_BA_session */ 952 /* this will allow the state check in stop_BA_session */
953 *state = HT_AGG_STATE_OPERATIONAL; 953 *state = HT_AGG_STATE_OPERATIONAL;
954 spin_unlock_bh(&sta->lock); 954 spin_unlock_bh(&sta->lock);
955 ieee80211_stop_tx_ba_session(hw, sta->addr, tid, 955 ieee80211_stop_tx_ba_session(hw, sta->sta.addr, tid,
956 WLAN_BACK_INITIATOR); 956 WLAN_BACK_INITIATOR);
957 } 957 }
958} 958}
@@ -979,14 +979,14 @@ void ieee80211_process_delba(struct ieee80211_sub_if_data *sdata,
979#endif /* CONFIG_MAC80211_HT_DEBUG */ 979#endif /* CONFIG_MAC80211_HT_DEBUG */
980 980
981 if (initiator == WLAN_BACK_INITIATOR) 981 if (initiator == WLAN_BACK_INITIATOR)
982 ieee80211_sta_stop_rx_ba_session(sdata, sta->addr, tid, 982 ieee80211_sta_stop_rx_ba_session(sdata, sta->sta.addr, tid,
983 WLAN_BACK_INITIATOR, 0); 983 WLAN_BACK_INITIATOR, 0);
984 else { /* WLAN_BACK_RECIPIENT */ 984 else { /* WLAN_BACK_RECIPIENT */
985 spin_lock_bh(&sta->lock); 985 spin_lock_bh(&sta->lock);
986 sta->ampdu_mlme.tid_state_tx[tid] = 986 sta->ampdu_mlme.tid_state_tx[tid] =
987 HT_AGG_STATE_OPERATIONAL; 987 HT_AGG_STATE_OPERATIONAL;
988 spin_unlock_bh(&sta->lock); 988 spin_unlock_bh(&sta->lock);
989 ieee80211_stop_tx_ba_session(&local->hw, sta->addr, tid, 989 ieee80211_stop_tx_ba_session(&local->hw, sta->sta.addr, tid,
990 WLAN_BACK_RECIPIENT); 990 WLAN_BACK_RECIPIENT);
991 } 991 }
992} 992}
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index f528962b13e3..a7ef0289fbdb 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -336,7 +336,8 @@ static int ieee80211_stop(struct net_device *dev)
336 336
337 list_for_each_entry_rcu(sta, &local->sta_list, list) { 337 list_for_each_entry_rcu(sta, &local->sta_list, list) {
338 if (sta->sdata == sdata) 338 if (sta->sdata == sdata)
339 ieee80211_sta_tear_down_BA_sessions(sdata, sta->addr); 339 ieee80211_sta_tear_down_BA_sessions(sdata,
340 sta->sta.addr);
340 } 341 }
341 342
342 rcu_read_unlock(); 343 rcu_read_unlock();
diff --git a/net/mac80211/key.c b/net/mac80211/key.c
index d5b95748db2a..57afcd38cd9e 100644
--- a/net/mac80211/key.c
+++ b/net/mac80211/key.c
@@ -123,7 +123,7 @@ static const u8 *get_mac_for_key(struct ieee80211_key *key)
123 addr = zero_addr; 123 addr = zero_addr;
124 124
125 if (key->sta) 125 if (key->sta)
126 addr = key->sta->addr; 126 addr = key->sta->sta.addr;
127 127
128 return addr; 128 return addr;
129} 129}
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index 1fad792ad258..15a5c99270a8 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -517,7 +517,7 @@ static void hwmp_prep_frame_process(struct ieee80211_sub_if_data *sdata,
517 spin_unlock_bh(&mpath->state_lock); 517 spin_unlock_bh(&mpath->state_lock);
518 goto fail; 518 goto fail;
519 } 519 }
520 memcpy(next_hop, mpath->next_hop->addr, ETH_ALEN); 520 memcpy(next_hop, mpath->next_hop->sta.addr, ETH_ALEN);
521 spin_unlock_bh(&mpath->state_lock); 521 spin_unlock_bh(&mpath->state_lock);
522 --ttl; 522 --ttl;
523 flags = PREP_IE_FLAGS(prep_elem); 523 flags = PREP_IE_FLAGS(prep_elem);
@@ -529,7 +529,7 @@ static void hwmp_prep_frame_process(struct ieee80211_sub_if_data *sdata,
529 529
530 mesh_path_sel_frame_tx(MPATH_PREP, flags, orig_addr, 530 mesh_path_sel_frame_tx(MPATH_PREP, flags, orig_addr,
531 cpu_to_le32(orig_dsn), 0, dst_addr, 531 cpu_to_le32(orig_dsn), 0, dst_addr,
532 cpu_to_le32(dst_dsn), mpath->next_hop->addr, hopcount, ttl, 532 cpu_to_le32(dst_dsn), mpath->next_hop->sta.addr, hopcount, ttl,
533 cpu_to_le32(lifetime), cpu_to_le32(metric), 533 cpu_to_le32(lifetime), cpu_to_le32(metric),
534 0, sdata); 534 0, sdata);
535 rcu_read_unlock(); 535 rcu_read_unlock();
@@ -557,7 +557,7 @@ static void hwmp_perr_frame_process(struct ieee80211_sub_if_data *sdata,
557 if (mpath) { 557 if (mpath) {
558 spin_lock_bh(&mpath->state_lock); 558 spin_lock_bh(&mpath->state_lock);
559 if (mpath->flags & MESH_PATH_ACTIVE && 559 if (mpath->flags & MESH_PATH_ACTIVE &&
560 memcmp(ta, mpath->next_hop->addr, ETH_ALEN) == 0 && 560 memcmp(ta, mpath->next_hop->sta.addr, ETH_ALEN) == 0 &&
561 (!(mpath->flags & MESH_PATH_DSN_VALID) || 561 (!(mpath->flags & MESH_PATH_DSN_VALID) ||
562 DSN_GT(dst_dsn, mpath->dsn))) { 562 DSN_GT(dst_dsn, mpath->dsn))) {
563 mpath->flags &= ~MESH_PATH_ACTIVE; 563 mpath->flags &= ~MESH_PATH_ACTIVE;
@@ -799,7 +799,7 @@ int mesh_nexthop_lookup(struct sk_buff *skb,
799 mesh_queue_preq(mpath, 799 mesh_queue_preq(mpath,
800 PREQ_Q_F_START | PREQ_Q_F_REFRESH); 800 PREQ_Q_F_START | PREQ_Q_F_REFRESH);
801 } 801 }
802 memcpy(hdr->addr1, mpath->next_hop->addr, 802 memcpy(hdr->addr1, mpath->next_hop->sta.addr,
803 ETH_ALEN); 803 ETH_ALEN);
804 } else { 804 } else {
805 if (!(mpath->flags & MESH_PATH_RESOLVING)) { 805 if (!(mpath->flags & MESH_PATH_RESOLVING)) {
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index 990a4b7f6bcc..debf7834dbc6 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -275,7 +275,7 @@ static void mesh_plink_timer(unsigned long data)
275 return; 275 return;
276 } 276 }
277 mpl_dbg("Mesh plink timer for %s fired on state %d\n", 277 mpl_dbg("Mesh plink timer for %s fired on state %d\n",
278 print_mac(mac, sta->addr), sta->plink_state); 278 print_mac(mac, sta->sta.addr), sta->plink_state);
279 reason = 0; 279 reason = 0;
280 llid = sta->llid; 280 llid = sta->llid;
281 plid = sta->plid; 281 plid = sta->plid;
@@ -288,7 +288,7 @@ static void mesh_plink_timer(unsigned long data)
288 if (sta->plink_retries < dot11MeshMaxRetries(sdata)) { 288 if (sta->plink_retries < dot11MeshMaxRetries(sdata)) {
289 u32 rand; 289 u32 rand;
290 mpl_dbg("Mesh plink for %s (retry, timeout): %d %d\n", 290 mpl_dbg("Mesh plink for %s (retry, timeout): %d %d\n",
291 print_mac(mac, sta->addr), 291 print_mac(mac, sta->sta.addr),
292 sta->plink_retries, sta->plink_timeout); 292 sta->plink_retries, sta->plink_timeout);
293 get_random_bytes(&rand, sizeof(u32)); 293 get_random_bytes(&rand, sizeof(u32));
294 sta->plink_timeout = sta->plink_timeout + 294 sta->plink_timeout = sta->plink_timeout +
@@ -296,7 +296,7 @@ static void mesh_plink_timer(unsigned long data)
296 ++sta->plink_retries; 296 ++sta->plink_retries;
297 mod_plink_timer(sta, sta->plink_timeout); 297 mod_plink_timer(sta, sta->plink_timeout);
298 spin_unlock_bh(&sta->lock); 298 spin_unlock_bh(&sta->lock);
299 mesh_plink_frame_tx(sdata, PLINK_OPEN, sta->addr, llid, 299 mesh_plink_frame_tx(sdata, PLINK_OPEN, sta->sta.addr, llid,
300 0, 0); 300 0, 0);
301 break; 301 break;
302 } 302 }
@@ -309,7 +309,7 @@ static void mesh_plink_timer(unsigned long data)
309 sta->plink_state = PLINK_HOLDING; 309 sta->plink_state = PLINK_HOLDING;
310 mod_plink_timer(sta, dot11MeshHoldingTimeout(sdata)); 310 mod_plink_timer(sta, dot11MeshHoldingTimeout(sdata));
311 spin_unlock_bh(&sta->lock); 311 spin_unlock_bh(&sta->lock);
312 mesh_plink_frame_tx(sdata, PLINK_CLOSE, sta->addr, llid, plid, 312 mesh_plink_frame_tx(sdata, PLINK_CLOSE, sta->sta.addr, llid, plid,
313 reason); 313 reason);
314 break; 314 break;
315 case PLINK_HOLDING: 315 case PLINK_HOLDING:
@@ -352,10 +352,10 @@ int mesh_plink_open(struct sta_info *sta)
352 mesh_plink_timer_set(sta, dot11MeshRetryTimeout(sdata)); 352 mesh_plink_timer_set(sta, dot11MeshRetryTimeout(sdata));
353 spin_unlock_bh(&sta->lock); 353 spin_unlock_bh(&sta->lock);
354 mpl_dbg("Mesh plink: starting establishment with %s\n", 354 mpl_dbg("Mesh plink: starting establishment with %s\n",
355 print_mac(mac, sta->addr)); 355 print_mac(mac, sta->sta.addr));
356 356
357 return mesh_plink_frame_tx(sdata, PLINK_OPEN, 357 return mesh_plink_frame_tx(sdata, PLINK_OPEN,
358 sta->addr, llid, 0, 0); 358 sta->sta.addr, llid, 0, 0);
359} 359}
360 360
361void mesh_plink_block(struct sta_info *sta) 361void mesh_plink_block(struct sta_info *sta)
@@ -379,7 +379,7 @@ int mesh_plink_close(struct sta_info *sta)
379#endif 379#endif
380 380
381 mpl_dbg("Mesh plink: closing link with %s\n", 381 mpl_dbg("Mesh plink: closing link with %s\n",
382 print_mac(mac, sta->addr)); 382 print_mac(mac, sta->sta.addr));
383 spin_lock_bh(&sta->lock); 383 spin_lock_bh(&sta->lock);
384 sta->reason = cpu_to_le16(MESH_LINK_CANCELLED); 384 sta->reason = cpu_to_le16(MESH_LINK_CANCELLED);
385 reason = sta->reason; 385 reason = sta->reason;
@@ -400,7 +400,7 @@ int mesh_plink_close(struct sta_info *sta)
400 llid = sta->llid; 400 llid = sta->llid;
401 plid = sta->plid; 401 plid = sta->plid;
402 spin_unlock_bh(&sta->lock); 402 spin_unlock_bh(&sta->lock);
403 mesh_plink_frame_tx(sta->sdata, PLINK_CLOSE, sta->addr, llid, 403 mesh_plink_frame_tx(sta->sdata, PLINK_CLOSE, sta->sta.addr, llid,
404 plid, reason); 404 plid, reason);
405 return 0; 405 return 0;
406} 406}
@@ -577,9 +577,9 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
577 sta->llid = llid; 577 sta->llid = llid;
578 mesh_plink_timer_set(sta, dot11MeshRetryTimeout(sdata)); 578 mesh_plink_timer_set(sta, dot11MeshRetryTimeout(sdata));
579 spin_unlock_bh(&sta->lock); 579 spin_unlock_bh(&sta->lock);
580 mesh_plink_frame_tx(sdata, PLINK_OPEN, sta->addr, llid, 580 mesh_plink_frame_tx(sdata, PLINK_OPEN, sta->sta.addr, llid,
581 0, 0); 581 0, 0);
582 mesh_plink_frame_tx(sdata, PLINK_CONFIRM, sta->addr, 582 mesh_plink_frame_tx(sdata, PLINK_CONFIRM, sta->sta.addr,
583 llid, plid, 0); 583 llid, plid, 0);
584 break; 584 break;
585 default: 585 default:
@@ -604,7 +604,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
604 604
605 llid = sta->llid; 605 llid = sta->llid;
606 spin_unlock_bh(&sta->lock); 606 spin_unlock_bh(&sta->lock);
607 mesh_plink_frame_tx(sdata, PLINK_CLOSE, sta->addr, llid, 607 mesh_plink_frame_tx(sdata, PLINK_CLOSE, sta->sta.addr, llid,
608 plid, reason); 608 plid, reason);
609 break; 609 break;
610 case OPN_ACPT: 610 case OPN_ACPT:
@@ -613,7 +613,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
613 sta->plid = plid; 613 sta->plid = plid;
614 llid = sta->llid; 614 llid = sta->llid;
615 spin_unlock_bh(&sta->lock); 615 spin_unlock_bh(&sta->lock);
616 mesh_plink_frame_tx(sdata, PLINK_CONFIRM, sta->addr, llid, 616 mesh_plink_frame_tx(sdata, PLINK_CONFIRM, sta->sta.addr, llid,
617 plid, 0); 617 plid, 0);
618 break; 618 break;
619 case CNF_ACPT: 619 case CNF_ACPT:
@@ -646,13 +646,13 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
646 646
647 llid = sta->llid; 647 llid = sta->llid;
648 spin_unlock_bh(&sta->lock); 648 spin_unlock_bh(&sta->lock);
649 mesh_plink_frame_tx(sdata, PLINK_CLOSE, sta->addr, llid, 649 mesh_plink_frame_tx(sdata, PLINK_CLOSE, sta->sta.addr, llid,
650 plid, reason); 650 plid, reason);
651 break; 651 break;
652 case OPN_ACPT: 652 case OPN_ACPT:
653 llid = sta->llid; 653 llid = sta->llid;
654 spin_unlock_bh(&sta->lock); 654 spin_unlock_bh(&sta->lock);
655 mesh_plink_frame_tx(sdata, PLINK_CONFIRM, sta->addr, llid, 655 mesh_plink_frame_tx(sdata, PLINK_CONFIRM, sta->sta.addr, llid,
656 plid, 0); 656 plid, 0);
657 break; 657 break;
658 case CNF_ACPT: 658 case CNF_ACPT:
@@ -661,7 +661,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
661 mesh_plink_inc_estab_count(sdata); 661 mesh_plink_inc_estab_count(sdata);
662 spin_unlock_bh(&sta->lock); 662 spin_unlock_bh(&sta->lock);
663 mpl_dbg("Mesh plink with %s ESTABLISHED\n", 663 mpl_dbg("Mesh plink with %s ESTABLISHED\n",
664 print_mac(mac, sta->addr)); 664 print_mac(mac, sta->sta.addr));
665 break; 665 break;
666 default: 666 default:
667 spin_unlock_bh(&sta->lock); 667 spin_unlock_bh(&sta->lock);
@@ -685,7 +685,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
685 685
686 llid = sta->llid; 686 llid = sta->llid;
687 spin_unlock_bh(&sta->lock); 687 spin_unlock_bh(&sta->lock);
688 mesh_plink_frame_tx(sdata, PLINK_CLOSE, sta->addr, llid, 688 mesh_plink_frame_tx(sdata, PLINK_CLOSE, sta->sta.addr, llid,
689 plid, reason); 689 plid, reason);
690 break; 690 break;
691 case OPN_ACPT: 691 case OPN_ACPT:
@@ -694,8 +694,8 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
694 mesh_plink_inc_estab_count(sdata); 694 mesh_plink_inc_estab_count(sdata);
695 spin_unlock_bh(&sta->lock); 695 spin_unlock_bh(&sta->lock);
696 mpl_dbg("Mesh plink with %s ESTABLISHED\n", 696 mpl_dbg("Mesh plink with %s ESTABLISHED\n",
697 print_mac(mac, sta->addr)); 697 print_mac(mac, sta->sta.addr));
698 mesh_plink_frame_tx(sdata, PLINK_CONFIRM, sta->addr, llid, 698 mesh_plink_frame_tx(sdata, PLINK_CONFIRM, sta->sta.addr, llid,
699 plid, 0); 699 plid, 0);
700 break; 700 break;
701 default: 701 default:
@@ -714,13 +714,13 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
714 llid = sta->llid; 714 llid = sta->llid;
715 mod_plink_timer(sta, dot11MeshHoldingTimeout(sdata)); 715 mod_plink_timer(sta, dot11MeshHoldingTimeout(sdata));
716 spin_unlock_bh(&sta->lock); 716 spin_unlock_bh(&sta->lock);
717 mesh_plink_frame_tx(sdata, PLINK_CLOSE, sta->addr, llid, 717 mesh_plink_frame_tx(sdata, PLINK_CLOSE, sta->sta.addr, llid,
718 plid, reason); 718 plid, reason);
719 break; 719 break;
720 case OPN_ACPT: 720 case OPN_ACPT:
721 llid = sta->llid; 721 llid = sta->llid;
722 spin_unlock_bh(&sta->lock); 722 spin_unlock_bh(&sta->lock);
723 mesh_plink_frame_tx(sdata, PLINK_CONFIRM, sta->addr, llid, 723 mesh_plink_frame_tx(sdata, PLINK_CONFIRM, sta->sta.addr, llid,
724 plid, 0); 724 plid, 0);
725 break; 725 break;
726 default: 726 default:
@@ -743,8 +743,8 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
743 llid = sta->llid; 743 llid = sta->llid;
744 reason = sta->reason; 744 reason = sta->reason;
745 spin_unlock_bh(&sta->lock); 745 spin_unlock_bh(&sta->lock);
746 mesh_plink_frame_tx(sdata, PLINK_CLOSE, sta->addr, llid, 746 mesh_plink_frame_tx(sdata, PLINK_CLOSE, sta->sta.addr,
747 plid, reason); 747 llid, plid, reason);
748 break; 748 break;
749 default: 749 default:
750 spin_unlock_bh(&sta->lock); 750 spin_unlock_bh(&sta->lock);
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 8a2cfd3609b5..35c421b89dd2 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -804,7 +804,7 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
804 netif_tx_stop_all_queues(sdata->dev); 804 netif_tx_stop_all_queues(sdata->dev);
805 netif_carrier_off(sdata->dev); 805 netif_carrier_off(sdata->dev);
806 806
807 ieee80211_sta_tear_down_BA_sessions(sdata, sta->addr); 807 ieee80211_sta_tear_down_BA_sessions(sdata, sta->sta.addr);
808 808
809 if (self_disconnected) { 809 if (self_disconnected) {
810 if (deauth) 810 if (deauth)
@@ -1507,7 +1507,8 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
1507 printk(KERN_DEBUG "%s: updated supp_rates set " 1507 printk(KERN_DEBUG "%s: updated supp_rates set "
1508 "for %s based on beacon info (0x%llx | " 1508 "for %s based on beacon info (0x%llx | "
1509 "0x%llx -> 0x%llx)\n", 1509 "0x%llx -> 0x%llx)\n",
1510 sdata->dev->name, print_mac(mac, sta->addr), 1510 sdata->dev->name,
1511 print_mac(mac, sta->sta.addr),
1511 (unsigned long long) prev_rates, 1512 (unsigned long long) prev_rates,
1512 (unsigned long long) supp_rates, 1513 (unsigned long long) supp_rates,
1513 (unsigned long long) sta->supp_rates[band]); 1514 (unsigned long long) sta->supp_rates[band]);
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 8c3dda5f00b2..92d898b901e9 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -661,7 +661,7 @@ static void ap_sta_ps_start(struct net_device *dev, struct sta_info *sta)
661 set_and_clear_sta_flags(sta, WLAN_STA_PS, WLAN_STA_PSPOLL); 661 set_and_clear_sta_flags(sta, WLAN_STA_PS, WLAN_STA_PSPOLL);
662#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 662#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
663 printk(KERN_DEBUG "%s: STA %s aid %d enters power save mode\n", 663 printk(KERN_DEBUG "%s: STA %s aid %d enters power save mode\n",
664 dev->name, print_mac(mac, sta->addr), sta->aid); 664 dev->name, print_mac(mac, sta->sta.addr), sta->sta.aid);
665#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 665#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
666} 666}
667 667
@@ -685,7 +685,7 @@ static int ap_sta_ps_end(struct net_device *dev, struct sta_info *sta)
685 685
686#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 686#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
687 printk(KERN_DEBUG "%s: STA %s aid %d exits power save mode\n", 687 printk(KERN_DEBUG "%s: STA %s aid %d exits power save mode\n",
688 dev->name, print_mac(mac, sta->addr), sta->aid); 688 dev->name, print_mac(mac, sta->sta.addr), sta->sta.aid);
689#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 689#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
690 690
691 /* Send all buffered frames to the station */ 691 /* Send all buffered frames to the station */
@@ -702,7 +702,7 @@ static int ap_sta_ps_end(struct net_device *dev, struct sta_info *sta)
702#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 702#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
703 printk(KERN_DEBUG "%s: STA %s aid %d send PS frame " 703 printk(KERN_DEBUG "%s: STA %s aid %d send PS frame "
704 "since STA not sleeping anymore\n", dev->name, 704 "since STA not sleeping anymore\n", dev->name,
705 print_mac(mac, sta->addr), sta->aid); 705 print_mac(mac, sta->sta.addr), sta->sta.aid);
706#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 706#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
707 info->flags |= IEEE80211_TX_CTL_REQUEUE; 707 info->flags |= IEEE80211_TX_CTL_REQUEUE;
708 dev_queue_xmit(skb); 708 dev_queue_xmit(skb);
@@ -1007,7 +1007,7 @@ ieee80211_rx_h_ps_poll(struct ieee80211_rx_data *rx)
1007 1007
1008#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 1008#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
1009 printk(KERN_DEBUG "STA %s aid %d: PS Poll (entries after %d)\n", 1009 printk(KERN_DEBUG "STA %s aid %d: PS Poll (entries after %d)\n",
1010 print_mac(mac, rx->sta->addr), rx->sta->aid, 1010 print_mac(mac, rx->sta->sta.addr), rx->sta->sta.aid,
1011 skb_queue_len(&rx->sta->ps_tx_buf)); 1011 skb_queue_len(&rx->sta->ps_tx_buf));
1012#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 1012#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
1013 1013
@@ -1032,7 +1032,7 @@ ieee80211_rx_h_ps_poll(struct ieee80211_rx_data *rx)
1032 */ 1032 */
1033 printk(KERN_DEBUG "%s: STA %s sent PS Poll even " 1033 printk(KERN_DEBUG "%s: STA %s sent PS Poll even "
1034 "though there are no buffered frames for it\n", 1034 "though there are no buffered frames for it\n",
1035 rx->dev->name, print_mac(mac, rx->sta->addr)); 1035 rx->dev->name, print_mac(mac, rx->sta->sta.addr));
1036#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 1036#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
1037 } 1037 }
1038 1038
@@ -2140,7 +2140,7 @@ static u8 ieee80211_rx_reorder_ampdu(struct ieee80211_local *local,
2140 /* if this mpdu is fragmented - terminate rx aggregation session */ 2140 /* if this mpdu is fragmented - terminate rx aggregation session */
2141 sc = le16_to_cpu(hdr->seq_ctrl); 2141 sc = le16_to_cpu(hdr->seq_ctrl);
2142 if (sc & IEEE80211_SCTL_FRAG) { 2142 if (sc & IEEE80211_SCTL_FRAG) {
2143 ieee80211_sta_stop_rx_ba_session(sta->sdata, sta->addr, 2143 ieee80211_sta_stop_rx_ba_session(sta->sdata, sta->sta.addr,
2144 tid, 0, WLAN_REASON_QSTA_REQUIRE_SETUP); 2144 tid, 0, WLAN_REASON_QSTA_REQUIRE_SETUP);
2145 ret = 1; 2145 ret = 1;
2146 goto end_reorder; 2146 goto end_reorder;
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 31246d8e5327..d9774ac2e0f7 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -73,11 +73,11 @@ static int sta_info_hash_del(struct ieee80211_local *local,
73{ 73{
74 struct sta_info *s; 74 struct sta_info *s;
75 75
76 s = local->sta_hash[STA_HASH(sta->addr)]; 76 s = local->sta_hash[STA_HASH(sta->sta.addr)];
77 if (!s) 77 if (!s)
78 return -ENOENT; 78 return -ENOENT;
79 if (s == sta) { 79 if (s == sta) {
80 rcu_assign_pointer(local->sta_hash[STA_HASH(sta->addr)], 80 rcu_assign_pointer(local->sta_hash[STA_HASH(sta->sta.addr)],
81 s->hnext); 81 s->hnext);
82 return 0; 82 return 0;
83 } 83 }
@@ -94,13 +94,13 @@ static int sta_info_hash_del(struct ieee80211_local *local,
94 94
95/* protected by RCU */ 95/* protected by RCU */
96static struct sta_info *__sta_info_find(struct ieee80211_local *local, 96static struct sta_info *__sta_info_find(struct ieee80211_local *local,
97 u8 *addr) 97 const u8 *addr)
98{ 98{
99 struct sta_info *sta; 99 struct sta_info *sta;
100 100
101 sta = rcu_dereference(local->sta_hash[STA_HASH(addr)]); 101 sta = rcu_dereference(local->sta_hash[STA_HASH(addr)]);
102 while (sta) { 102 while (sta) {
103 if (compare_ether_addr(sta->addr, addr) == 0) 103 if (compare_ether_addr(sta->sta.addr, addr) == 0)
104 break; 104 break;
105 sta = rcu_dereference(sta->hnext); 105 sta = rcu_dereference(sta->hnext);
106 } 106 }
@@ -151,7 +151,7 @@ static void __sta_info_free(struct ieee80211_local *local,
151 151
152#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 152#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
153 printk(KERN_DEBUG "%s: Destroyed STA %s\n", 153 printk(KERN_DEBUG "%s: Destroyed STA %s\n",
154 wiphy_name(local->hw.wiphy), print_mac(mbuf, sta->addr)); 154 wiphy_name(local->hw.wiphy), print_mac(mbuf, sta->sta.addr));
155#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */ 155#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */
156 156
157 kfree(sta); 157 kfree(sta);
@@ -219,8 +219,8 @@ void sta_info_destroy(struct sta_info *sta)
219static void sta_info_hash_add(struct ieee80211_local *local, 219static void sta_info_hash_add(struct ieee80211_local *local,
220 struct sta_info *sta) 220 struct sta_info *sta)
221{ 221{
222 sta->hnext = local->sta_hash[STA_HASH(sta->addr)]; 222 sta->hnext = local->sta_hash[STA_HASH(sta->sta.addr)];
223 rcu_assign_pointer(local->sta_hash[STA_HASH(sta->addr)], sta); 223 rcu_assign_pointer(local->sta_hash[STA_HASH(sta->sta.addr)], sta);
224} 224}
225 225
226struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata, 226struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata,
@@ -231,14 +231,14 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata,
231 int i; 231 int i;
232 DECLARE_MAC_BUF(mbuf); 232 DECLARE_MAC_BUF(mbuf);
233 233
234 sta = kzalloc(sizeof(*sta), gfp); 234 sta = kzalloc(sizeof(*sta) + local->hw.sta_data_size, gfp);
235 if (!sta) 235 if (!sta)
236 return NULL; 236 return NULL;
237 237
238 spin_lock_init(&sta->lock); 238 spin_lock_init(&sta->lock);
239 spin_lock_init(&sta->flaglock); 239 spin_lock_init(&sta->flaglock);
240 240
241 memcpy(sta->addr, addr, ETH_ALEN); 241 memcpy(sta->sta.addr, addr, ETH_ALEN);
242 sta->local = local; 242 sta->local = local;
243 sta->sdata = sdata; 243 sta->sdata = sdata;
244 244
@@ -271,7 +271,7 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata,
271 271
272#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 272#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
273 printk(KERN_DEBUG "%s: Allocated STA %s\n", 273 printk(KERN_DEBUG "%s: Allocated STA %s\n",
274 wiphy_name(local->hw.wiphy), print_mac(mbuf, sta->addr)); 274 wiphy_name(local->hw.wiphy), print_mac(mbuf, sta->sta.addr));
275#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */ 275#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */
276 276
277#ifdef CONFIG_MAC80211_MESH 277#ifdef CONFIG_MAC80211_MESH
@@ -300,15 +300,15 @@ int sta_info_insert(struct sta_info *sta)
300 goto out_free; 300 goto out_free;
301 } 301 }
302 302
303 if (WARN_ON(compare_ether_addr(sta->addr, sdata->dev->dev_addr) == 0 || 303 if (WARN_ON(compare_ether_addr(sta->sta.addr, sdata->dev->dev_addr) == 0 ||
304 is_multicast_ether_addr(sta->addr))) { 304 is_multicast_ether_addr(sta->sta.addr))) {
305 err = -EINVAL; 305 err = -EINVAL;
306 goto out_free; 306 goto out_free;
307 } 307 }
308 308
309 spin_lock_irqsave(&local->sta_lock, flags); 309 spin_lock_irqsave(&local->sta_lock, flags);
310 /* check if STA exists already */ 310 /* check if STA exists already */
311 if (__sta_info_find(local, sta->addr)) { 311 if (__sta_info_find(local, sta->sta.addr)) {
312 spin_unlock_irqrestore(&local->sta_lock, flags); 312 spin_unlock_irqrestore(&local->sta_lock, flags);
313 err = -EEXIST; 313 err = -EEXIST;
314 goto out_free; 314 goto out_free;
@@ -325,12 +325,12 @@ int sta_info_insert(struct sta_info *sta)
325 u.ap); 325 u.ap);
326 326
327 local->ops->sta_notify(local_to_hw(local), &sdata->vif, 327 local->ops->sta_notify(local_to_hw(local), &sdata->vif,
328 STA_NOTIFY_ADD, sta->addr); 328 STA_NOTIFY_ADD, &sta->sta);
329 } 329 }
330 330
331#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 331#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
332 printk(KERN_DEBUG "%s: Inserted STA %s\n", 332 printk(KERN_DEBUG "%s: Inserted STA %s\n",
333 wiphy_name(local->hw.wiphy), print_mac(mac, sta->addr)); 333 wiphy_name(local->hw.wiphy), print_mac(mac, sta->sta.addr));
334#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */ 334#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */
335 335
336 spin_unlock_irqrestore(&local->sta_lock, flags); 336 spin_unlock_irqrestore(&local->sta_lock, flags);
@@ -379,11 +379,12 @@ static void __sta_info_set_tim_bit(struct ieee80211_if_ap *bss,
379{ 379{
380 BUG_ON(!bss); 380 BUG_ON(!bss);
381 381
382 __bss_tim_set(bss, sta->aid); 382 __bss_tim_set(bss, sta->sta.aid);
383 383
384 if (sta->local->ops->set_tim) { 384 if (sta->local->ops->set_tim) {
385 sta->local->tim_in_locked_section = true; 385 sta->local->tim_in_locked_section = true;
386 sta->local->ops->set_tim(local_to_hw(sta->local), sta->aid, 1); 386 sta->local->ops->set_tim(local_to_hw(sta->local),
387 &sta->sta, true);
387 sta->local->tim_in_locked_section = false; 388 sta->local->tim_in_locked_section = false;
388 } 389 }
389} 390}
@@ -404,11 +405,12 @@ static void __sta_info_clear_tim_bit(struct ieee80211_if_ap *bss,
404{ 405{
405 BUG_ON(!bss); 406 BUG_ON(!bss);
406 407
407 __bss_tim_clear(bss, sta->aid); 408 __bss_tim_clear(bss, sta->sta.aid);
408 409
409 if (sta->local->ops->set_tim) { 410 if (sta->local->ops->set_tim) {
410 sta->local->tim_in_locked_section = true; 411 sta->local->tim_in_locked_section = true;
411 sta->local->ops->set_tim(local_to_hw(sta->local), sta->aid, 0); 412 sta->local->ops->set_tim(local_to_hw(sta->local),
413 &sta->sta, false);
412 sta->local->tim_in_locked_section = false; 414 sta->local->tim_in_locked_section = false;
413 } 415 }
414} 416}
@@ -462,7 +464,7 @@ static void __sta_info_unlink(struct sta_info **sta)
462 u.ap); 464 u.ap);
463 465
464 local->ops->sta_notify(local_to_hw(local), &sdata->vif, 466 local->ops->sta_notify(local_to_hw(local), &sdata->vif,
465 STA_NOTIFY_REMOVE, (*sta)->addr); 467 STA_NOTIFY_REMOVE, &(*sta)->sta);
466 } 468 }
467 469
468 if (ieee80211_vif_is_mesh(&sdata->vif)) { 470 if (ieee80211_vif_is_mesh(&sdata->vif)) {
@@ -474,7 +476,7 @@ static void __sta_info_unlink(struct sta_info **sta)
474 476
475#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 477#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
476 printk(KERN_DEBUG "%s: Removed STA %s\n", 478 printk(KERN_DEBUG "%s: Removed STA %s\n",
477 wiphy_name(local->hw.wiphy), print_mac(mbuf, (*sta)->addr)); 479 wiphy_name(local->hw.wiphy), print_mac(mbuf, (*sta)->sta.addr));
478#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */ 480#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */
479 481
480 /* 482 /*
@@ -570,7 +572,7 @@ static void sta_info_cleanup_expire_buffered(struct ieee80211_local *local,
570 local->total_ps_buffered--; 572 local->total_ps_buffered--;
571#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 573#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
572 printk(KERN_DEBUG "Buffered frame expired (STA " 574 printk(KERN_DEBUG "Buffered frame expired (STA "
573 "%s)\n", print_mac(mac, sta->addr)); 575 "%s)\n", print_mac(mac, sta->sta.addr));
574#endif 576#endif
575 dev_kfree_skb(skb); 577 dev_kfree_skb(skb);
576 578
@@ -817,7 +819,7 @@ void ieee80211_sta_expire(struct ieee80211_sub_if_data *sdata,
817 if (time_after(jiffies, sta->last_rx + exp_time)) { 819 if (time_after(jiffies, sta->last_rx + exp_time)) {
818#ifdef CONFIG_MAC80211_IBSS_DEBUG 820#ifdef CONFIG_MAC80211_IBSS_DEBUG
819 printk(KERN_DEBUG "%s: expiring inactive STA %s\n", 821 printk(KERN_DEBUG "%s: expiring inactive STA %s\n",
820 sdata->dev->name, print_mac(mac, sta->addr)); 822 sdata->dev->name, print_mac(mac, sta->sta.addr));
821#endif 823#endif
822 __sta_info_unlink(&sta); 824 __sta_info_unlink(&sta);
823 if (sta) 825 if (sta)
@@ -828,3 +830,14 @@ void ieee80211_sta_expire(struct ieee80211_sub_if_data *sdata,
828 list_for_each_entry_safe(sta, tmp, &tmp_list, list) 830 list_for_each_entry_safe(sta, tmp, &tmp_list, list)
829 sta_info_destroy(sta); 831 sta_info_destroy(sta);
830} 832}
833
834struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_hw *hw,
835 const u8 *addr)
836{
837 struct sta_info *sta = __sta_info_find(hw_to_local(hw), addr);
838
839 if (!sta)
840 return NULL;
841 return &sta->sta;
842}
843EXPORT_SYMBOL(ieee80211_find_sta);
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index 220079900991..e7ce12dbf270 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -218,6 +218,7 @@ struct sta_ampdu_mlme {
218 * @plink_timeout: TBD 218 * @plink_timeout: TBD
219 * @plink_timer: TBD 219 * @plink_timer: TBD
220 * @debugfs: debug filesystem info 220 * @debugfs: debug filesystem info
221 * @sta: station information we share with the driver
221 */ 222 */
222struct sta_info { 223struct sta_info {
223 /* General information, mostly static */ 224 /* General information, mostly static */
@@ -232,8 +233,7 @@ struct sta_info {
232 spinlock_t flaglock; 233 spinlock_t flaglock;
233 struct ieee80211_ht_info ht_info; 234 struct ieee80211_ht_info ht_info;
234 u64 supp_rates[IEEE80211_NUM_BANDS]; 235 u64 supp_rates[IEEE80211_NUM_BANDS];
235 u8 addr[ETH_ALEN]; 236
236 u16 aid;
237 u16 listen_interval; 237 u16 listen_interval;
238 238
239 /* 239 /*
@@ -327,6 +327,9 @@ struct sta_info {
327 struct dentry *agg_status; 327 struct dentry *agg_status;
328 } debugfs; 328 } debugfs;
329#endif 329#endif
330
331 /* keep last! */
332 struct ieee80211_sta sta;
330}; 333};
331 334
332static inline enum plink_state sta_plink_state(struct sta_info *sta) 335static inline enum plink_state sta_plink_state(struct sta_info *sta)
diff --git a/net/mac80211/tkip.c b/net/mac80211/tkip.c
index 995f7af3d25e..34b32bc8f609 100644
--- a/net/mac80211/tkip.c
+++ b/net/mac80211/tkip.c
@@ -304,7 +304,7 @@ int ieee80211_tkip_decrypt_data(struct crypto_blkcipher *tfm,
304 key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) { 304 key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) {
305 u8 bcast[ETH_ALEN] = 305 u8 bcast[ETH_ALEN] =
306 {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; 306 {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
307 u8 *sta_addr = key->sta->addr; 307 u8 *sta_addr = key->sta->sta.addr;
308 308
309 if (is_multicast_ether_addr(ra)) 309 if (is_multicast_ether_addr(ra))
310 sta_addr = bcast; 310 sta_addr = bcast;
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index f4bcc589d674..07bf228d0b16 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -381,7 +381,7 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx)
381#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 381#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
382 printk(KERN_DEBUG "STA %s aid %d: PS buffer (entries " 382 printk(KERN_DEBUG "STA %s aid %d: PS buffer (entries "
383 "before %d)\n", 383 "before %d)\n",
384 print_mac(mac, sta->addr), sta->aid, 384 print_mac(mac, sta->sta.addr), sta->sta.aid,
385 skb_queue_len(&sta->ps_tx_buf)); 385 skb_queue_len(&sta->ps_tx_buf));
386#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 386#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
387 if (tx->local->total_ps_buffered >= TOTAL_MAX_TX_BUFFER) 387 if (tx->local->total_ps_buffered >= TOTAL_MAX_TX_BUFFER)
@@ -392,7 +392,7 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx)
392 if (net_ratelimit()) { 392 if (net_ratelimit()) {
393 printk(KERN_DEBUG "%s: STA %s TX " 393 printk(KERN_DEBUG "%s: STA %s TX "
394 "buffer full - dropping oldest frame\n", 394 "buffer full - dropping oldest frame\n",
395 tx->dev->name, print_mac(mac, sta->addr)); 395 tx->dev->name, print_mac(mac, sta->sta.addr));
396 } 396 }
397#endif 397#endif
398 dev_kfree_skb(old); 398 dev_kfree_skb(old);
@@ -411,7 +411,7 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx)
411 else if (unlikely(test_sta_flags(sta, WLAN_STA_PS))) { 411 else if (unlikely(test_sta_flags(sta, WLAN_STA_PS))) {
412 printk(KERN_DEBUG "%s: STA %s in PS mode, but pspoll " 412 printk(KERN_DEBUG "%s: STA %s in PS mode, but pspoll "
413 "set -> send frame\n", tx->dev->name, 413 "set -> send frame\n", tx->dev->name,
414 print_mac(mac, sta->addr)); 414 print_mac(mac, sta->sta.addr));
415 } 415 }
416#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 416#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
417 clear_sta_flags(sta, WLAN_STA_PSPOLL); 417 clear_sta_flags(sta, WLAN_STA_PSPOLL);
@@ -528,7 +528,7 @@ ieee80211_tx_h_misc(struct ieee80211_tx_data *tx)
528 sband = tx->local->hw.wiphy->bands[tx->channel->band]; 528 sband = tx->local->hw.wiphy->bands[tx->channel->band];
529 529
530 if (tx->sta) 530 if (tx->sta)
531 info->control.aid = tx->sta->aid; 531 info->control.sta = &tx->sta->sta;
532 532
533 if (!info->control.retry_limit) { 533 if (!info->control.retry_limit) {
534 if (!is_multicast_ether_addr(hdr->addr1)) { 534 if (!is_multicast_ether_addr(hdr->addr1)) {
@@ -608,7 +608,7 @@ ieee80211_tx_h_misc(struct ieee80211_tx_data *tx)
608 } 608 }
609 609
610 if (tx->sta) 610 if (tx->sta)
611 info->control.aid = tx->sta->aid; 611 info->control.sta = &tx->sta->sta;
612 612
613 return TX_CONTINUE; 613 return TX_CONTINUE;
614} 614}
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c
index 7229e958879d..6748dedcab50 100644
--- a/net/mac80211/wme.c
+++ b/net/mac80211/wme.c
@@ -210,7 +210,7 @@ int ieee80211_ht_agg_queue_add(struct ieee80211_local *local,
210 DECLARE_MAC_BUF(mac); 210 DECLARE_MAC_BUF(mac);
211 printk(KERN_DEBUG "allocated aggregation queue" 211 printk(KERN_DEBUG "allocated aggregation queue"
212 " %d tid %d addr %s pool=0x%lX\n", 212 " %d tid %d addr %s pool=0x%lX\n",
213 i, tid, print_mac(mac, sta->addr), 213 i, tid, print_mac(mac, sta->sta.addr),
214 local->queue_pool[0]); 214 local->queue_pool[0]);
215 } 215 }
216#endif /* CONFIG_MAC80211_HT_DEBUG */ 216#endif /* CONFIG_MAC80211_HT_DEBUG */
diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c
index 78021780b885..37ae9a959f63 100644
--- a/net/mac80211/wpa.c
+++ b/net/mac80211/wpa.c
@@ -256,7 +256,7 @@ ieee80211_crypto_tkip_decrypt(struct ieee80211_rx_data *rx)
256 256
257 res = ieee80211_tkip_decrypt_data(rx->local->wep_rx_tfm, 257 res = ieee80211_tkip_decrypt_data(rx->local->wep_rx_tfm,
258 key, skb->data + hdrlen, 258 key, skb->data + hdrlen,
259 skb->len - hdrlen, rx->sta->addr, 259 skb->len - hdrlen, rx->sta->sta.addr,
260 hdr->addr1, hwaccel, rx->queue, 260 hdr->addr1, hwaccel, rx->queue,
261 &rx->tkip_iv32, 261 &rx->tkip_iv32,
262 &rx->tkip_iv16); 262 &rx->tkip_iv16);