[PATCH master 14/23] net: macb: use DMA-capable memory for receive buffer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The driver supports older MACB-compatible NICs as well as the newer
GEM-compatible NICs. Both use DMA, but the older MACB support failed to
allocate the single receive buffer with suitable alignment.

Use net_alloc_packet() to fix that.

Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
---
 drivers/net/macb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index f5b2fa74dc23..bcad88f60e7a 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -910,7 +910,7 @@ static int macb_probe(struct device *dev)
 		macb->gem_q1_descs = dma_alloc_coherent(GEM_Q1_DESC_BYTES,
 				DMA_ADDRESS_BROKEN);
 
-	macb->rx_packet_buf = xmalloc(PKTSIZE);
+	macb->rx_packet_buf = net_alloc_packet();
 
 	macb_reset_hw(macb);
 	ncfgr = macb_mdc_clk_div(macb);
@@ -938,7 +938,7 @@ static void macb_remove(struct device *dev)
 
 	macb_halt(&macb->netdev);
 
-	free(macb->rx_packet_buf);
+	net_free_packet(macb->rx_packet_buf);
 }
 
 static const struct macb_config fu540_c000_config = {
-- 
2.39.2





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux