[legacy] Rename the global legacy NIC to "legacy_nic"

We currently have contexts in which the local variable "nic" is a
pointer to the global variable also called "nic".  This complicates
the creation of macros.

Rename the global variable to "legacy_nic" to reduce pollution of the
global namespace and to allow for the creation of macros referring to
fields within this global variable.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2025-06-24 13:10:53 +01:00
parent d0c02e0df8
commit 6ea800ab54
2 changed files with 16 additions and 12 deletions

View File

@@ -67,15 +67,17 @@ struct nic_operations {
void ( *irq ) ( struct nic *, irq_action_t );
};
extern struct nic nic;
extern struct nic legacy_nic;
static inline int eth_poll ( int retrieve ) {
return nic.nic_op->poll ( &nic, retrieve );
struct nic *nic = &legacy_nic;
return nic->nic_op->poll ( nic, retrieve );
}
static inline void eth_transmit ( const char *dest, unsigned int type,
unsigned int size, const void *packet ) {
nic.nic_op->transmit ( &nic, dest, type, size, packet );
struct nic *nic = &legacy_nic;
nic->nic_op->transmit ( nic, dest, type, size, packet );
}
/*