mirror of
https://gitlab.com/qemu-project/ipxe.git
synced 2025-11-03 07:59:06 +08:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e03647347d |
@ -121,10 +121,9 @@ int ecm_fetch_mac ( struct usb_function *func,
|
||||
}
|
||||
|
||||
/* Apply system-specific MAC address as current link-layer
|
||||
* address, if present and not already used.
|
||||
* address, if present.
|
||||
*/
|
||||
if ( ( ( rc = acpi_mac ( amac ) ) == 0 ) &&
|
||||
! find_netdev_by_ll_addr ( ðernet_protocol, amac ) ) {
|
||||
if ( ( rc = acpi_mac ( amac ) ) == 0 ) {
|
||||
memcpy ( netdev->ll_addr, amac, ETH_ALEN );
|
||||
DBGC ( usb, "USB %s using system-specific MAC %s\n",
|
||||
func->name, eth_ntoa ( netdev->ll_addr ) );
|
||||
|
||||
@ -729,8 +729,6 @@ extern struct net_device * find_netdev ( const char *name );
|
||||
extern struct net_device * find_netdev_by_scope_id ( unsigned int scope_id );
|
||||
extern struct net_device * find_netdev_by_location ( unsigned int bus_type,
|
||||
unsigned int location );
|
||||
extern struct net_device *
|
||||
find_netdev_by_ll_addr ( struct ll_protocol *ll_protocol, const void *ll_addr );
|
||||
extern struct net_device * last_opened_netdev ( void );
|
||||
extern int net_tx ( struct io_buffer *iobuf, struct net_device *netdev,
|
||||
struct net_protocol *net_protocol, const void *ll_dest,
|
||||
|
||||
@ -735,18 +735,6 @@ int register_netdev ( struct net_device *netdev ) {
|
||||
ll_protocol->ll_header_len );
|
||||
}
|
||||
|
||||
/* Reject network devices that are already available via a
|
||||
* different hardware device.
|
||||
*/
|
||||
duplicate = find_netdev_by_ll_addr ( ll_protocol, netdev->ll_addr );
|
||||
if ( duplicate && ( duplicate->dev != netdev->dev ) ) {
|
||||
DBGC ( netdev, "NETDEV rejecting duplicate (phys %s) of %s "
|
||||
"(phys %s)\n", netdev->dev->name, duplicate->name,
|
||||
duplicate->dev->name );
|
||||
rc = -EEXIST;
|
||||
goto err_duplicate;
|
||||
}
|
||||
|
||||
/* Reject named network devices that already exist */
|
||||
if ( netdev->name[0] && ( duplicate = find_netdev ( netdev->name ) ) ) {
|
||||
DBGC ( netdev, "NETDEV rejecting duplicate name %s\n",
|
||||
@ -1002,27 +990,6 @@ struct net_device * find_netdev_by_location ( unsigned int bus_type,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get network device by link-layer address
|
||||
*
|
||||
* @v ll_protocol Link-layer protocol
|
||||
* @v ll_addr Link-layer address
|
||||
* @ret netdev Network device, or NULL
|
||||
*/
|
||||
struct net_device * find_netdev_by_ll_addr ( struct ll_protocol *ll_protocol,
|
||||
const void *ll_addr ) {
|
||||
struct net_device *netdev;
|
||||
|
||||
list_for_each_entry ( netdev, &net_devices, list ) {
|
||||
if ( ( netdev->ll_protocol == ll_protocol ) &&
|
||||
( memcmp ( netdev->ll_addr, ll_addr,
|
||||
ll_protocol->ll_addr_len ) == 0 ) )
|
||||
return netdev;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get most recently opened network device
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user