summaryrefslogtreecommitdiffstats
path: root/src/drivers/net/sundance.c
diff options
context:
space:
mode:
authorMichael Brown2025-06-24 14:17:19 +0200
committerMichael Brown2025-06-24 14:41:51 +0200
commitd3e10ebd354928d56ba660cd2ea14af1663702a2 (patch)
treee9265e1ecdfb1b9bad6453f00d5c04c38a33728f /src/drivers/net/sundance.c
parent[legacy] Rename the global legacy NIC to "legacy_nic" (diff)
downloadipxe-d3e10ebd354928d56ba660cd2ea14af1663702a2.tar.gz
ipxe-d3e10ebd354928d56ba660cd2ea14af1663702a2.tar.xz
ipxe-d3e10ebd354928d56ba660cd2ea14af1663702a2.zip
[legacy] Allocate legacy driver .bss-like segments at probe time
Some legacy drivers use large static allocations for transmit and receive buffers. To avoid bloating the .bss segment, we currently implement these as a single common symbol named "_shared_bss" (which is permissible since only one legacy driver may be active at any one time). Switch to dynamic allocation of these .bss-like segments, to avoid the requirement for using common symbols. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers/net/sundance.c')
-rw-r--r--src/drivers/net/sundance.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/drivers/net/sundance.c b/src/drivers/net/sundance.c
index 0439c983f..964365ef6 100644
--- a/src/drivers/net/sundance.c
+++ b/src/drivers/net/sundance.c
@@ -233,10 +233,11 @@ static struct netdev_desc rx_ring[RX_RING_SIZE];
/* Create a static buffer of size PKT_BUF_SZ for each RX and TX descriptor.
All descriptors point to a part of this buffer */
-struct {
+struct sundance_bss {
unsigned char txb[PKT_BUF_SZ * TX_RING_SIZE];
unsigned char rxb[RX_RING_SIZE * PKT_BUF_SZ];
-} rx_tx_buf __shared;
+};
+#define rx_tx_buf NIC_FAKE_BSS ( struct sundance_bss )
#define rxb rx_tx_buf.rxb
#define txb rx_tx_buf.txb
@@ -888,7 +889,7 @@ static struct pci_device_id sundance_nics[] = {
PCI_DRIVER ( sundance_driver, sundance_nics, PCI_NO_CLASS );
DRIVER ( "SUNDANCE/PCI", nic_driver, pci_driver, sundance_driver,
- sundance_probe, sundance_disable );
+ sundance_probe, sundance_disable, rx_tx_buf );
/*
* Local variables: