Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 17741cdc authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

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: default avatarJohannes Berg <johannes@sipsolutions.net>
Cc: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 8aa21e6f
Loading
Loading
Loading
Loading
+14 −16
Original line number Diff line number Diff line
@@ -1405,7 +1405,7 @@ static void ath9k_configure_filter(struct ieee80211_hw *hw,
static void ath9k_sta_notify(struct ieee80211_hw *hw,
			     struct ieee80211_vif *vif,
			     enum sta_notify_cmd cmd,
			     const u8 *addr)
			     struct ieee80211_sta *sta)
{
	struct ath_softc *sc = hw->priv;
	struct ath_node *an;
@@ -1413,19 +1413,18 @@ static void ath9k_sta_notify(struct ieee80211_hw *hw,
	DECLARE_MAC_BUF(mac);

	spin_lock_irqsave(&sc->node_lock, flags);
	an = ath_node_find(sc, (u8 *) addr);
	an = ath_node_find(sc, sta->addr);
	spin_unlock_irqrestore(&sc->node_lock, flags);

	switch (cmd) {
	case STA_NOTIFY_ADD:
		spin_lock_irqsave(&sc->node_lock, flags);
		if (!an) {
			ath_node_attach(sc, (u8 *)addr, 0);
			ath_node_attach(sc, sta->addr, 0);
			DPRINTF(sc, ATH_DBG_CONFIG, "%s: Attach a node: %s\n",
				__func__,
				print_mac(mac, addr));
				__func__, print_mac(mac, sta->addr));
		} else {
			ath_node_get(sc, (u8 *)addr);
			ath_node_get(sc, sta->addr);
		}
		spin_unlock_irqrestore(&sc->node_lock, flags);
		break;
@@ -1438,7 +1437,7 @@ static void ath9k_sta_notify(struct ieee80211_hw *hw,
			ath_node_put(sc, an, ATH9K_BH_STATUS_INTACT);
			DPRINTF(sc, ATH_DBG_CONFIG, "%s: Put a node: %s\n",
				__func__,
				print_mac(mac, addr));
				print_mac(mac, sta->addr));
		}
		break;
	default:
@@ -1581,45 +1580,44 @@ static void ath9k_reset_tsf(struct ieee80211_hw *hw)

static int ath9k_ampdu_action(struct ieee80211_hw *hw,
		       enum ieee80211_ampdu_mlme_action action,
		       const u8 *addr,
		       u16 tid,
		       u16 *ssn)
		       struct ieee80211_sta *sta,
		       u16 tid, u16 *ssn)
{
	struct ath_softc *sc = hw->priv;
	int ret = 0;

	switch (action) {
	case IEEE80211_AMPDU_RX_START:
		ret = ath_rx_aggr_start(sc, addr, tid, ssn);
		ret = ath_rx_aggr_start(sc, sta->addr, tid, ssn);
		if (ret < 0)
			DPRINTF(sc, ATH_DBG_FATAL,
				"%s: Unable to start RX aggregation\n",
				__func__);
		break;
	case IEEE80211_AMPDU_RX_STOP:
		ret = ath_rx_aggr_stop(sc, addr, tid);
		ret = ath_rx_aggr_stop(sc, sta->addr, tid);
		if (ret < 0)
			DPRINTF(sc, ATH_DBG_FATAL,
				"%s: Unable to stop RX aggregation\n",
				__func__);
		break;
	case IEEE80211_AMPDU_TX_START:
		ret = ath_tx_aggr_start(sc, addr, tid, ssn);
		ret = ath_tx_aggr_start(sc, sta->addr, tid, ssn);
		if (ret < 0)
			DPRINTF(sc, ATH_DBG_FATAL,
				"%s: Unable to start TX aggregation\n",
				__func__);
		else
			ieee80211_start_tx_ba_cb_irqsafe(hw, (u8 *)addr, tid);
			ieee80211_start_tx_ba_cb_irqsafe(hw, sta->addr, tid);
		break;
	case IEEE80211_AMPDU_TX_STOP:
		ret = ath_tx_aggr_stop(sc, addr, tid);
		ret = ath_tx_aggr_stop(sc, sta->addr, tid);
		if (ret < 0)
			DPRINTF(sc, ATH_DBG_FATAL,
				"%s: Unable to stop TX aggregation\n",
				__func__);

		ieee80211_stop_tx_ba_cb_irqsafe(hw, (u8 *)addr, tid);
		ieee80211_stop_tx_ba_cb_irqsafe(hw, sta->addr, tid);
		break;
	default:
		DPRINTF(sc, ATH_DBG_FATAL,
+3 −2
Original line number Diff line number Diff line
@@ -4234,7 +4234,8 @@ static int b43_op_set_retry_limit(struct ieee80211_hw *hw,
	return err;
}

static int b43_op_beacon_set_tim(struct ieee80211_hw *hw, int aid, int set)
static int b43_op_beacon_set_tim(struct ieee80211_hw *hw,
				 struct ieee80211_sta *sta, bool set)
{
	struct b43_wl *wl = hw_to_b43_wl(hw);
	unsigned long flags;
@@ -4249,7 +4250,7 @@ static int b43_op_beacon_set_tim(struct ieee80211_hw *hw, int aid, int set)
static void b43_op_sta_notify(struct ieee80211_hw *hw,
			      struct ieee80211_vif *vif,
			      enum sta_notify_cmd notify_cmd,
			      const u8 *addr)
			      struct ieee80211_sta *sta)
{
	struct b43_wl *wl = hw_to_b43_wl(hw);

+1 −1
Original line number Diff line number Diff line
@@ -3403,7 +3403,7 @@ static int b43legacy_op_set_retry_limit(struct ieee80211_hw *hw,
}

static int b43legacy_op_beacon_set_tim(struct ieee80211_hw *hw,
				       int aid, int set)
				       struct ieee80211_sta *sta, bool set)
{
	struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw);
	unsigned long flags;
+6 −6
Original line number Diff line number Diff line
@@ -366,8 +366,8 @@ static void rs_tl_turn_on_agg_for_tid(struct iwl_priv *priv,
	if (state == HT_AGG_STATE_IDLE &&
	    rs_tl_get_load(lq_data, tid) > IWL_AGG_LOAD_THRESHOLD) {
		IWL_DEBUG_HT("Starting Tx agg: STA: %s tid: %d\n",
				print_mac(mac, sta->addr), tid);
		ieee80211_start_tx_ba_session(priv->hw, sta->addr, tid);
				print_mac(mac, sta->sta.addr), tid);
		ieee80211_start_tx_ba_session(priv->hw, sta->sta.addr, tid);
	}
}

@@ -2244,17 +2244,17 @@ static void rs_rate_init(void *priv_rate, void *priv_sta,

	lq_sta->ibss_sta_added = 0;
	if (priv->iw_mode == NL80211_IFTYPE_AP) {
		u8 sta_id = iwl_find_station(priv, sta->addr);
		u8 sta_id = iwl_find_station(priv, sta->sta.addr);
		DECLARE_MAC_BUF(mac);

		/* for IBSS the call are from tasklet */
		IWL_DEBUG_RATE("LQ: ADD station %s\n",
			     print_mac(mac, sta->addr));
			     print_mac(mac, sta->sta.addr));

		if (sta_id == IWL_INVALID_STATION) {
			IWL_DEBUG_RATE("LQ: ADD station %s\n",
				       print_mac(mac, sta->addr));
			sta_id = iwl_add_station_flags(priv, sta->addr,
				       print_mac(mac, sta->sta.addr));
			sta_id = iwl_add_station_flags(priv, sta->sta.addr,
							0, CMD_ASYNC, NULL);
		}
		if ((sta_id != IWL_INVALID_STATION)) {
+6 −6
Original line number Diff line number Diff line
@@ -3413,13 +3413,13 @@ static int iwl4965_mac_conf_tx(struct ieee80211_hw *hw, u16 queue,

static int iwl4965_mac_ampdu_action(struct ieee80211_hw *hw,
			     enum ieee80211_ampdu_mlme_action action,
			     const u8 *addr, u16 tid, u16 *ssn)
			     struct ieee80211_sta *sta, u16 tid, u16 *ssn)
{
	struct iwl_priv *priv = hw->priv;
	DECLARE_MAC_BUF(mac);

	IWL_DEBUG_HT("A-MPDU action on addr %s tid %d\n",
		     print_mac(mac, addr), tid);
		     print_mac(mac, sta->addr), tid);

	if (!(priv->cfg->sku & IWL_SKU_N))
		return -EACCES;
@@ -3427,16 +3427,16 @@ static int iwl4965_mac_ampdu_action(struct ieee80211_hw *hw,
	switch (action) {
	case IEEE80211_AMPDU_RX_START:
		IWL_DEBUG_HT("start Rx\n");
		return iwl_rx_agg_start(priv, addr, tid, *ssn);
		return iwl_rx_agg_start(priv, sta->addr, tid, *ssn);
	case IEEE80211_AMPDU_RX_STOP:
		IWL_DEBUG_HT("stop Rx\n");
		return iwl_rx_agg_stop(priv, addr, tid);
		return iwl_rx_agg_stop(priv, sta->addr, tid);
	case IEEE80211_AMPDU_TX_START:
		IWL_DEBUG_HT("start Tx\n");
		return iwl_tx_agg_start(priv, addr, tid, ssn);
		return iwl_tx_agg_start(priv, sta->addr, tid, ssn);
	case IEEE80211_AMPDU_TX_STOP:
		IWL_DEBUG_HT("stop Tx\n");
		return iwl_tx_agg_stop(priv, addr, tid);
		return iwl_tx_agg_stop(priv, sta->addr, tid);
	default:
		IWL_DEBUG_HT("unknown\n");
		return -EINVAL;
Loading