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

ath9k: Simplify node attach/detach routines

Signed-off-by: default avatarSujith <Sujith.Manoharan@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent b5aa9bf9
...@@ -1366,8 +1366,9 @@ void ath_node_attach(struct ath_softc *sc, struct ieee80211_sta *sta, int if_id) ...@@ -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; 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); ath_tx_node_init(sc, an);
if (sc->sc_flags & SC_OP_RXAGGR)
ath_rx_node_init(sc, an); ath_rx_node_init(sc, an);
an->maxampdu = 1 << (IEEE80211_HTCAP_MAXRXAMPDU_FACTOR + an->maxampdu = 1 << (IEEE80211_HTCAP_MAXRXAMPDU_FACTOR +
...@@ -1384,10 +1385,10 @@ void ath_node_detach(struct ath_softc *sc, struct ieee80211_sta *sta) ...@@ -1384,10 +1385,10 @@ void ath_node_detach(struct ath_softc *sc, struct ieee80211_sta *sta)
ath_chainmask_sel_timerstop(&an->an_chainmask_sel); ath_chainmask_sel_timerstop(&an->an_chainmask_sel);
if (sc->sc_flags & SC_OP_TXAGGR)
ath_tx_node_cleanup(sc, an); ath_tx_node_cleanup(sc, an);
if (sc->sc_flags & SC_OP_RXAGGR)
ath_tx_node_free(sc, an); ath_rx_node_cleanup(sc, an);
ath_rx_node_free(sc, an);
} }
/* /*
......
...@@ -372,7 +372,7 @@ bool ath_stoprecv(struct ath_softc *sc); ...@@ -372,7 +372,7 @@ bool ath_stoprecv(struct ath_softc *sc);
void ath_flushrecv(struct ath_softc *sc); void ath_flushrecv(struct ath_softc *sc);
u32 ath_calcrxfilter(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_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); void ath_handle_rx_intr(struct ath_softc *sc);
int ath_rx_init(struct ath_softc *sc, int nbufs); int ath_rx_init(struct ath_softc *sc, int nbufs);
void ath_rx_cleanup(struct ath_softc *sc); 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) ...@@ -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) 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; struct ath_arx_tid *rxtid;
int tidno; int tidno;
...@@ -1227,12 +1226,10 @@ void ath_rx_node_init(struct ath_softc *sc, struct ath_node *an) ...@@ -1227,12 +1226,10 @@ void ath_rx_node_init(struct ath_softc *sc, struct ath_node *an)
/* ADDBA state */ /* ADDBA state */
rxtid->addba_exchangecomplete = 0; 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; struct ath_arx_tid *rxtid;
int tidno, i; int tidno, i;
...@@ -1255,6 +1252,4 @@ void ath_rx_node_free(struct ath_softc *sc, struct ath_node *an) ...@@ -1255,6 +1252,4 @@ void ath_rx_node_free(struct ath_softc *sc, struct ath_node *an)
rxtid->addba_exchangecomplete = 0; rxtid->addba_exchangecomplete = 0;
} }
}
} }
...@@ -2565,7 +2565,6 @@ void ath_txq_schedule(struct ath_softc *sc, struct ath_txq *txq) ...@@ -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) 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_tid *tid;
struct ath_atx_ac *ac; struct ath_atx_ac *ac;
int tidno, acno; int tidno, acno;
...@@ -2622,7 +2621,6 @@ void ath_tx_node_init(struct ath_softc *sc, struct ath_node *an) ...@@ -2622,7 +2621,6 @@ void ath_tx_node_init(struct ath_softc *sc, struct ath_node *an)
break; break;
} }
} }
}
} }
/* Cleanupthe pending buffers for the node. */ /* Cleanupthe pending buffers for the node. */
...@@ -2664,25 +2662,6 @@ void ath_tx_node_cleanup(struct ath_softc *sc, struct ath_node *an) ...@@ -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) void ath_tx_cabq(struct ath_softc *sc, struct sk_buff *skb)
{ {
int hdrlen, padsize; int hdrlen, padsize;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment