summaryrefslogtreecommitdiffstats
path: root/src/drivers/net/ath/ath9k
diff options
context:
space:
mode:
authorMichael Brown2016-01-28 15:15:36 +0100
committerMichael Brown2016-01-28 15:24:24 +0100
commitd0bfd830e4e5ddd1015dda66833a99b068b6a519 (patch)
treed764e2cbe795b67bc5b99e12b2c4230df1dd7822 /src/drivers/net/ath/ath9k
parent[slam] Avoid potential division by zero (diff)
downloadipxe-d0bfd830e4e5ddd1015dda66833a99b068b6a519.tar.gz
ipxe-d0bfd830e4e5ddd1015dda66833a99b068b6a519.tar.xz
ipxe-d0bfd830e4e5ddd1015dda66833a99b068b6a519.zip
[ath9k] Remove broken ath_rxbuf_alloc()
ath_rx_init() demonstrates some serious confusion over how to use pointers, resulting in (uint32_t*)NULL being used as a temporary variable. This does not end well. The broken code in question is performing manual alignment of I/O buffers, which can now be achieved more simply using alloc_iob_raw(). Fix by removing ath_rxbuf_alloc() entirely. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers/net/ath/ath9k')
-rw-r--r--src/drivers/net/ath/ath9k/ath9k_recv.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/drivers/net/ath/ath9k/ath9k_recv.c b/src/drivers/net/ath/ath9k/ath9k_recv.c
index ba363c676..0ffe9d45a 100644
--- a/src/drivers/net/ath/ath9k/ath9k_recv.c
+++ b/src/drivers/net/ath/ath9k/ath9k_recv.c
@@ -98,7 +98,6 @@ int ath_rx_init(struct ath_softc *sc, int nbufs)
{
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
struct io_buffer *iob;
- u32 *iob_addr = NULL;
struct ath_buf *bf;
int error = 0;
@@ -122,15 +121,14 @@ int ath_rx_init(struct ath_softc *sc, int nbufs)
}
list_for_each_entry(bf, &sc->rx.rxbuf, list) {
- iob = ath_rxbuf_alloc(common, common->rx_bufsize,
- iob_addr);
+ iob = alloc_iob_raw ( common->rx_bufsize, common->cachelsz, 0 );
if (iob == NULL) {
error = -ENOMEM;
goto err;
}
bf->bf_mpdu = iob;
- bf->bf_buf_addr = *iob_addr;
+ bf->bf_buf_addr = virt_to_bus ( iob->data );
}
sc->rx.rxlink = NULL;
@@ -433,7 +431,6 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, int hp __unused)
{
struct ath_buf *bf;
struct io_buffer *iob = NULL, *requeue_iob;
- u32 *requeue_iob_addr = NULL;
struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(ah);
/*
@@ -476,7 +473,8 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, int hp __unused)
/* Ensure we always have an iob to requeue once we are done
* processing the current buffer's iob */
- requeue_iob = ath_rxbuf_alloc(common, common->rx_bufsize, requeue_iob_addr);
+ requeue_iob = alloc_iob_raw ( common->rx_bufsize,
+ common->cachelsz, 0 );
/* If there is no memory we ignore the current RX'd frame,
* tell hardware it can give us a new frame using the old
@@ -491,7 +489,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, int hp __unused)
/* We will now give hardware our shiny new allocated iob */
bf->bf_mpdu = requeue_iob;
- bf->bf_buf_addr = *requeue_iob_addr;
+ bf->bf_buf_addr = virt_to_bus ( requeue_iob->data );
/*
* change the default rx antenna if rx diversity chooses the