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

Commit c5170163 authored by Sujith's avatar Sujith Committed by John W. Linville
Browse files

ath9k: Simplify node attach/detach routines

parent b5aa9bf9
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -1366,8 +1366,9 @@ void ath_node_attach(struct ath_softc *sc, struct ieee80211_sta *sta, int if_id)

	an = (struct ath_node *)sta->drv_priv;

	/* set up per-node tx/rx state */
	if (sc->sc_flags & SC_OP_TXAGGR)
		ath_tx_node_init(sc, an);
	if (sc->sc_flags & SC_OP_RXAGGR)
		ath_rx_node_init(sc, an);

	an->maxampdu = 1 << (IEEE80211_HTCAP_MAXRXAMPDU_FACTOR +
@@ -1384,10 +1385,10 @@ void ath_node_detach(struct ath_softc *sc, struct ieee80211_sta *sta)

	ath_chainmask_sel_timerstop(&an->an_chainmask_sel);

	if (sc->sc_flags & SC_OP_TXAGGR)
		ath_tx_node_cleanup(sc, an);

	ath_tx_node_free(sc, an);
	ath_rx_node_free(sc, an);
	if (sc->sc_flags & SC_OP_RXAGGR)
		ath_rx_node_cleanup(sc, an);
}

/*
+1 −1
Original line number Diff line number Diff line
@@ -372,7 +372,7 @@ bool ath_stoprecv(struct ath_softc *sc);
void ath_flushrecv(struct ath_softc *sc);
u32 ath_calcrxfilter(struct ath_softc *sc);
void ath_rx_node_init(struct ath_softc *sc, struct ath_node *an);
void ath_rx_node_free(struct ath_softc *sc, struct ath_node *an);
void ath_rx_node_cleanup(struct ath_softc *sc, struct ath_node *an);
void ath_handle_rx_intr(struct ath_softc *sc);
int ath_rx_init(struct ath_softc *sc, int nbufs);
void ath_rx_cleanup(struct ath_softc *sc);
+38 −43
Original line number Diff line number Diff line
@@ -1200,7 +1200,6 @@ void ath_rx_aggr_teardown(struct ath_softc *sc, struct ath_node *an, u8 tid)

void ath_rx_node_init(struct ath_softc *sc, struct ath_node *an)
{
	if (sc->sc_flags & SC_OP_RXAGGR) {
	struct ath_arx_tid *rxtid;
	int tidno;

@@ -1228,11 +1227,9 @@ void ath_rx_node_init(struct ath_softc *sc, struct ath_node *an)
		rxtid->addba_exchangecomplete = 0;
	}
}
}

void ath_rx_node_free(struct ath_softc *sc, struct ath_node *an)
void ath_rx_node_cleanup(struct ath_softc *sc, struct ath_node *an)
{
	if (sc->sc_flags & SC_OP_RXAGGR) {
	struct ath_arx_tid *rxtid;
	int tidno, i;

@@ -1256,5 +1253,3 @@ void ath_rx_node_free(struct ath_softc *sc, struct ath_node *an)
		rxtid->addba_exchangecomplete = 0;
	}
}

}
+52 −73
Original line number Diff line number Diff line
@@ -2565,7 +2565,6 @@ void ath_txq_schedule(struct ath_softc *sc, struct ath_txq *txq)

void ath_tx_node_init(struct ath_softc *sc, struct ath_node *an)
{
	if (sc->sc_flags & SC_OP_TXAGGR) {
	struct ath_atx_tid *tid;
	struct ath_atx_ac *ac;
	int tidno, acno;
@@ -2623,7 +2622,6 @@ void ath_tx_node_init(struct ath_softc *sc, struct ath_node *an)
		}
	}
}
}

/* Cleanupthe pending buffers for the node. */

@@ -2664,25 +2662,6 @@ void ath_tx_node_cleanup(struct ath_softc *sc, struct ath_node *an)
	}
}

/* Cleanup per node transmit state */

void ath_tx_node_free(struct ath_softc *sc, struct ath_node *an)
{
	if (sc->sc_flags & SC_OP_TXAGGR) {
		struct ath_atx_tid *tid;
		int tidno, i;

		/* Init per tid rx state */
		for (tidno = 0, tid = &an->an_aggr.tx.tid[tidno];
			tidno < WME_NUM_TID;
		     tidno++, tid++) {

			for (i = 0; i < ATH_TID_MAX_BUFS; i++)
				ASSERT(tid->tx_buf[i] == NULL);
		}
	}
}

void ath_tx_cabq(struct ath_softc *sc, struct sk_buff *skb)
{
	int hdrlen, padsize;