mirror of
https://github.com/ipxe/ipxe
synced 2026-01-07 20:52:03 +03:00
[malloc] Rename malloc_dma() to malloc_phys()
The malloc_dma() function allocates memory with specified physical alignment, and is typically (though not exclusively) used to allocate memory for DMA. Rename to malloc_phys() to more closely match the functionality, and to create name space for functions that specifically allocate and map DMA-capable buffers. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -877,7 +877,7 @@ ath5k_desc_alloc(struct ath5k_softc *sc)
|
||||
|
||||
/* allocate descriptors */
|
||||
sc->desc_len = sizeof(struct ath5k_desc) * (ATH_TXBUF + ATH_RXBUF + 1);
|
||||
sc->desc = malloc_dma(sc->desc_len, ATH5K_DESC_ALIGN);
|
||||
sc->desc = malloc_phys(sc->desc_len, ATH5K_DESC_ALIGN);
|
||||
if (sc->desc == NULL) {
|
||||
DBG("ath5k: can't allocate descriptors\n");
|
||||
ret = -ENOMEM;
|
||||
@@ -915,7 +915,7 @@ ath5k_desc_alloc(struct ath5k_softc *sc)
|
||||
return 0;
|
||||
|
||||
err_free:
|
||||
free_dma(sc->desc, sc->desc_len);
|
||||
free_phys(sc->desc, sc->desc_len);
|
||||
err:
|
||||
sc->desc = NULL;
|
||||
return ret;
|
||||
@@ -932,7 +932,7 @@ ath5k_desc_free(struct ath5k_softc *sc)
|
||||
ath5k_rxbuf_free(sc, bf);
|
||||
|
||||
/* Free memory associated with all descriptors */
|
||||
free_dma(sc->desc, sc->desc_len);
|
||||
free_phys(sc->desc, sc->desc_len);
|
||||
|
||||
free(sc->bufptr);
|
||||
sc->bufptr = NULL;
|
||||
|
||||
@@ -223,7 +223,7 @@ int ath_descdma_setup(struct ath_softc *sc, struct ath_descdma *dd,
|
||||
}
|
||||
|
||||
/* allocate descriptors */
|
||||
dd->dd_desc = malloc_dma(dd->dd_desc_len, 16);
|
||||
dd->dd_desc = malloc_phys(dd->dd_desc_len, 16);
|
||||
if (dd->dd_desc == NULL) {
|
||||
error = -ENOMEM;
|
||||
goto fail;
|
||||
@@ -264,7 +264,7 @@ int ath_descdma_setup(struct ath_softc *sc, struct ath_descdma *dd,
|
||||
}
|
||||
return 0;
|
||||
fail2:
|
||||
free_dma(dd->dd_desc, dd->dd_desc_len);
|
||||
free_phys(dd->dd_desc, dd->dd_desc_len);
|
||||
fail:
|
||||
memset(dd, 0, sizeof(*dd));
|
||||
return error;
|
||||
@@ -588,7 +588,7 @@ void ath_descdma_cleanup(struct ath_softc *sc __unused,
|
||||
struct ath_descdma *dd,
|
||||
struct list_head *head)
|
||||
{
|
||||
free_dma(dd->dd_desc, dd->dd_desc_len);
|
||||
free_phys(dd->dd_desc, dd->dd_desc_len);
|
||||
|
||||
INIT_LIST_HEAD(head);
|
||||
free(dd->dd_bufptr);
|
||||
|
||||
Reference in New Issue
Block a user