diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2022-09-19 10:01:29 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-09-19 10:11:12 +0200 |
commit | 1f6f4222ee78dedae936b0ee54ef4f621d915d3b (patch) | |
tree | 986503798693a81b6e360c1c6a755a12cd8587ed | |
parent | d503d102722e34a97c8cf510ef81a62009c08f53 (diff) | |
download | barebox-1f6f4222ee78dedae936b0ee54ef4f621d915d3b.tar.gz barebox-1f6f4222ee78dedae936b0ee54ef4f621d915d3b.tar.xz |
net: efi-snp: Allocate own receive buffer
Use a driver private buffer as network receive buffer rather than the
globally allocated ones which will be removed soon.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.barebox.org/20220919080133.877651-6-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | drivers/net/efi-snp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/efi-snp.c b/drivers/net/efi-snp.c index 9cb7144187..d30da820a0 100644 --- a/drivers/net/efi-snp.c +++ b/drivers/net/efi-snp.c @@ -120,6 +120,7 @@ struct efi_snp_priv { struct device_d *dev; struct eth_device edev; struct efi_simple_network *snp; + void *rx_buf; }; static inline struct efi_snp_priv *to_priv(struct eth_device *edev) @@ -163,7 +164,7 @@ static int efi_snp_eth_rx(struct eth_device *edev) long bufsize = PKTSIZE; efi_status_t efiret; - efiret = priv->snp->receive(priv->snp, NULL, &bufsize, NetRxPackets[0], NULL, NULL, NULL); + efiret = priv->snp->receive(priv->snp, NULL, &bufsize, priv->rx_buf, NULL, NULL, NULL); if (efiret == EFI_NOT_READY) return 0; @@ -172,7 +173,7 @@ static int efi_snp_eth_rx(struct eth_device *edev) return -efi_errno(efiret); } - net_receive(edev, NetRxPackets[0], bufsize); + net_receive(edev, priv->rx_buf, bufsize); return 0; } @@ -285,6 +286,7 @@ static int efi_snp_probe(struct efi_device *efidev) priv = xzalloc(sizeof(struct efi_snp_priv)); priv->snp = efidev->protocol; priv->dev = &efidev->dev; + priv->rx_buf = xmalloc(PKTSIZE); dev_dbg(&efidev->dev, "perm: %02x:%02x:%02x:%02x:%02x:%02x\n", priv->snp->Mode->PermanentAddress.Addr[0], |