mirror of
https://github.com/ipxe/ipxe
synced 2026-02-05 19:12:46 +03:00
[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:
@@ -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 );
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user