mirror of
https://github.com/ipxe/ipxe
synced 2025-12-26 01:22:37 +03:00
[ethernet] Move Ethernet MAC address checking routines to ethernet.h
Originally-fixed-by: Faur Andrei <da3drus@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -18,6 +18,7 @@ FILE_LICENCE(GPL2_ONLY);
|
||||
#include <stdio.h>
|
||||
#include <ipxe/malloc.h>
|
||||
#include <ipxe/iobuf.h>
|
||||
#include <ipxe/ethernet.h>
|
||||
#include <byteswap.h>
|
||||
|
||||
#include "vxge_traffic.h"
|
||||
|
||||
@@ -211,22 +211,6 @@ struct vxgedev {
|
||||
char fw_version[VXGE_HW_FW_STRLEN];
|
||||
};
|
||||
|
||||
static inline int is_zero_ether_addr(const u8 *addr)
|
||||
{
|
||||
return !(addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5]);
|
||||
}
|
||||
|
||||
static inline int is_multicast_ether_addr(const u8 *addr)
|
||||
{
|
||||
return (0x01 & addr[0]);
|
||||
}
|
||||
|
||||
/* checks the ethernet address @addr is a valid unicast */
|
||||
static inline int is_valid_ether_addr(const u8 *addr)
|
||||
{
|
||||
return !is_multicast_ether_addr(addr) && !is_zero_ether_addr(addr);
|
||||
}
|
||||
|
||||
void vxge_vpath_intr_enable(struct vxgedev *vdev, int vp_id);
|
||||
|
||||
void vxge_vpath_intr_disable(struct vxgedev *vdev, int vp_id);
|
||||
|
||||
Reference in New Issue
Block a user