summaryrefslogtreecommitdiffstats
path: root/src/drivers/net/dmfe.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/dmfe.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/dmfe.c')
-rw-r--r--src/drivers/net/dmfe.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/drivers/net/dmfe.c b/src/drivers/net/dmfe.c
index a76dd792d..2ed108e8c 100644
--- a/src/drivers/net/dmfe.c
+++ b/src/drivers/net/dmfe.c
@@ -209,14 +209,15 @@ static u8 SF_mode; /* Special Function: 1:VLAN, 2:RX Flow Control
/**********************************************
* Descriptor Ring and Buffer defination
***********************************************/
-struct {
+struct dmfe_bss {
struct tx_desc txd[TX_DESC_CNT] __attribute__ ((aligned(32)));
unsigned char txb[TX_BUF_ALLOC * TX_DESC_CNT]
__attribute__ ((aligned(32)));
struct rx_desc rxd[RX_DESC_CNT] __attribute__ ((aligned(32)));
unsigned char rxb[RX_ALLOC_SIZE * RX_DESC_CNT]
__attribute__ ((aligned(32)));
-} dmfe_bufs __shared;
+};
+#define dmfe_bufs NIC_FAKE_BSS ( struct dmfe_bss )
#define txd dmfe_bufs.txd
#define txb dmfe_bufs.txb
#define rxd dmfe_bufs.rxd
@@ -1217,7 +1218,7 @@ static struct pci_device_id dmfe_nics[] = {
PCI_DRIVER ( dmfe_driver, dmfe_nics, PCI_NO_CLASS );
DRIVER ( "DMFE/PCI", nic_driver, pci_driver, dmfe_driver,
- dmfe_probe, dmfe_disable );
+ dmfe_probe, dmfe_disable, dmfe_bufs );
/*
* Local variables: