aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/net/realtek.c
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2020-11-05 19:08:48 +0000
committerMichael Brown <mcb30@ipxe.org>2020-11-05 19:13:52 +0000
commitbe1c87b72237f633c4f4b05bcb133acf2967d788 (patch)
treeadc9bc36da62d55f0f1f5708af7c66d1cc3af949 /src/drivers/net/realtek.c
parent36dde9b0bf27ae411af677ca1fa3075113133cfe (diff)
downloadipxe-be1c87b72237f633c4f4b05bcb133acf2967d788.tar.gz
[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>
Diffstat (limited to 'src/drivers/net/realtek.c')
-rw-r--r--src/drivers/net/realtek.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/drivers/net/realtek.c b/src/drivers/net/realtek.c
index e74128c4c..f432dce5f 100644
--- a/src/drivers/net/realtek.c
+++ b/src/drivers/net/realtek.c
@@ -514,7 +514,7 @@ static int realtek_create_buffer ( struct realtek_nic *rtl ) {
return 0;
/* Allocate buffer */
- rtl->rx_buffer = malloc_dma ( len, RTL_RXBUF_ALIGN );
+ rtl->rx_buffer = malloc_phys ( len, RTL_RXBUF_ALIGN );
if ( ! rtl->rx_buffer ) {
rc = -ENOMEM;
goto err_alloc;
@@ -539,7 +539,7 @@ static int realtek_create_buffer ( struct realtek_nic *rtl ) {
return 0;
err_64bit:
- free_dma ( rtl->rx_buffer, len );
+ free_phys ( rtl->rx_buffer, len );
rtl->rx_buffer = NULL;
err_alloc:
return rc;
@@ -561,7 +561,7 @@ static void realtek_destroy_buffer ( struct realtek_nic *rtl ) {
writel ( 0, rtl->regs + RTL_RBSTART );
/* Free buffer */
- free_dma ( rtl->rx_buffer, len );
+ free_phys ( rtl->rx_buffer, len );
rtl->rx_buffer = NULL;
rtl->rx_offset = 0;
}
@@ -582,7 +582,7 @@ static int realtek_create_ring ( struct realtek_nic *rtl,
return 0;
/* Allocate descriptor ring */
- ring->desc = malloc_dma ( ring->len, RTL_RING_ALIGN );
+ ring->desc = malloc_phys ( ring->len, RTL_RING_ALIGN );
if ( ! ring->desc )
return -ENOMEM;
@@ -623,7 +623,7 @@ static void realtek_destroy_ring ( struct realtek_nic *rtl,
writel ( 0, rtl->regs + ring->reg + 4 );
/* Free descriptor ring */
- free_dma ( ring->desc, ring->len );
+ free_phys ( ring->desc, ring->len );
ring->desc = NULL;
}