[PATCH 02/42] build fix: add ath_rx_bufhead and ath_tx_bufhead
Oleksij Rempel
linux at rempel-privat.de
Mon Apr 1 02:50:54 EDT 2013
Normally we have two working type of buffers tx and rx.
In some generic situations, for example ath_descdma_setup,
we do not really care about buffer type, here we can use
ath_bufhead.
Signed-off-by: Oleksij Rempel <linux at rempel-privat.de>
---
target_firmware/wlan/if_ath.c | 18 +++++++++---------
target_firmware/wlan/if_athvar.h | 10 +++++++---
2 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/target_firmware/wlan/if_ath.c b/target_firmware/wlan/if_ath.c
index 409aecf..30165d4 100755
--- a/target_firmware/wlan/if_ath.c
+++ b/target_firmware/wlan/if_ath.c
@@ -879,7 +879,7 @@ static void ath_descdma_cleanup(struct ath_softc_tgt *sc,
struct ath_descdma *dd,
ath_bufhead *head, a_int32_t dir)
{
- struct ath_tx_buf *bf;
+ struct ath_buf *bf;
struct ieee80211_node_target *ni;
asf_tailq_foreach(bf, head, bf_list) {
@@ -924,7 +924,7 @@ static a_int32_t ath_desc_alloc(struct ath_softc_tgt *sc)
if (ath_numrxdescs == -1)
ath_numrxdescs = ATH_RXDESC;
- error = ath_descdma_setup(sc, &sc->sc_rxdma, &sc->sc_rxbuf,
+ error = ath_descdma_setup(sc, &sc->sc_rxdma, (ath_bufhead *)&sc->sc_rxbuf,
"rx", ath_numrxdescs, 1,
sizeof(struct ath_rx_buf),
sizeof(struct ath_rx_desc));
@@ -961,24 +961,24 @@ static a_int32_t ath_desc_alloc(struct ath_softc_tgt *sc)
asf_tailq_insert_tail(&sc->sc_rxdesc, ds, ds_list);
}
- error = ath_descdma_setup(sc, &sc->sc_txdma, &sc->sc_txbuf,
+ error = ath_descdma_setup(sc, &sc->sc_txdma, (ath_bufhead *)&sc->sc_txbuf,
"tx", ATH_TXBUF + 1, ATH_TXDESC,
sizeof(struct ath_tx_buf),
sizeof(struct ath_tx_desc));
if (error != 0) {
- ath_descdma_cleanup(sc, &sc->sc_rxdma, &sc->sc_rxbuf,
+ ath_descdma_cleanup(sc, &sc->sc_rxdma, (ath_bufhead *)&sc->sc_rxbuf,
ADF_OS_DMA_FROM_DEVICE);
return error;
}
- error = ath_descdma_setup(sc, &sc->sc_bdma, &sc->sc_bbuf,
+ error = ath_descdma_setup(sc, &sc->sc_bdma, (ath_bufhead *)&sc->sc_bbuf,
"beacon", ATH_BCBUF, 1,
sizeof(struct ath_tx_buf),
sizeof(struct ath_tx_desc));
if (error != 0) {
- ath_descdma_cleanup(sc, &sc->sc_txdma, &sc->sc_txbuf,
+ ath_descdma_cleanup(sc, &sc->sc_txdma, (ath_bufhead *)&sc->sc_txbuf,
ADF_OS_DMA_TO_DEVICE);
- ath_descdma_cleanup(sc, &sc->sc_rxdma, &sc->sc_rxbuf,
+ ath_descdma_cleanup(sc, &sc->sc_rxdma, (ath_bufhead *)&sc->sc_rxbuf,
ADF_OS_DMA_FROM_DEVICE);
return error;
}
@@ -1001,10 +1001,10 @@ static void ath_desc_free(struct ath_softc_tgt *sc)
sc->sc_txbuf_held = NULL;
if (sc->sc_txdma.dd_desc_len != 0)
- ath_descdma_cleanup(sc, &sc->sc_txdma, &sc->sc_txbuf,
+ ath_descdma_cleanup(sc, &sc->sc_txdma, (ath_bufhead *)&sc->sc_txbuf,
ADF_OS_DMA_TO_DEVICE);
if (sc->sc_rxdma.dd_desc_len != 0)
- ath_descdma_cleanup(sc, &sc->sc_rxdma, &sc->sc_rxbuf,
+ ath_descdma_cleanup(sc, &sc->sc_rxdma, (ath_bufhead *)&sc->sc_rxbuf,
ADF_OS_DMA_FROM_DEVICE);
}
diff --git a/target_firmware/wlan/if_athvar.h b/target_firmware/wlan/if_athvar.h
index db1dfee..f5ac24f 100755
--- a/target_firmware/wlan/if_athvar.h
+++ b/target_firmware/wlan/if_athvar.h
@@ -194,7 +194,6 @@ struct ath_buf_state {
#define bf_retries bf_state.bfs_retries
#define ATH_GENERIC_BUF \
- asf_tailq_entry(ath_buf) bf_list; \
struct ath_buf *bf_next; \
struct ath_desc *bf_desc; \
struct ath_desc *bf_descarr; \
@@ -208,11 +207,13 @@ struct ath_buf_state {
struct ath_buf
{
ATH_GENERIC_BUF
+ asf_tailq_entry(ath_buf) bf_list;
};
struct ath_tx_buf
{
ATH_GENERIC_BUF
+ asf_tailq_entry(ath_tx_buf) bf_list;
struct ath_buf_state bf_state;
a_uint16_t bf_flags;
HTC_ENDPOINT_ID bf_endpt;
@@ -223,6 +224,7 @@ struct ath_tx_buf
struct ath_rx_buf
{
ATH_GENERIC_BUF
+ asf_tailq_entry(ath_rx_buf) bf_list;
a_uint32_t bf_status;
struct ath_rx_status bf_rx_status;
};
@@ -234,6 +236,8 @@ struct ath_rx_buf
typedef asf_tailq_head(ath_deschead_s, ath_rx_desc) ath_deschead;
typedef asf_tailq_head(ath_bufhead_s, ath_buf) ath_bufhead;
+typedef asf_tailq_head(ath_rx_bufhead_s, ath_rx_buf) ath_rx_bufhead;
+typedef asf_tailq_head(ath_tx_bufhead_s, ath_tx_buf) ath_tx_bufhead;
#define WME_NUM_TID 8
#define WME_BA_BMP_SIZE 64
@@ -379,7 +383,7 @@ struct ath_softc_tgt
tq_struct sc_txtotq;
tq_struct sc_fataltq;
- ath_bufhead sc_rxbuf;
+ ath_rx_bufhead sc_rxbuf;
ath_deschead sc_rxdesc_idle;
ath_deschead sc_rxdesc;
@@ -392,7 +396,7 @@ struct ath_softc_tgt
struct ath_descdma sc_bdma;
a_uint32_t *sc_rxlink;
- ath_bufhead sc_txbuf;
+ ath_tx_bufhead sc_txbuf;
a_uint8_t sc_txqsetup;
struct ath_txq sc_txq[HAL_NUM_TX_QUEUES];
--
1.8.1.2
More information about the Ath9k_htc_fw
mailing list