[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:
Michael Brown
2010-06-04 22:24:45 +03:00
parent 3fc4fd3213
commit 75333f464e
3 changed files with 67 additions and 16 deletions

View File

@@ -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"

View File

@@ -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);