ath9k: Simplify node attach/detach routines
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
b5aa9bf946
commit
c51701632c
4 changed files with 95 additions and 120 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue