aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath9k/main.c
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 /drivers/net/wireless/ath9k/main.c
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>
Diffstat (limited to 'drivers/net/wireless/ath9k/main.c')
-rw-r--r--drivers/net/wireless/ath9k/main.c30
1 files changed, 14 insertions, 16 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,