Closed cyanide-burnout closed 3 years ago
void ixgbe_get_mac_addr(struct ixy_device* ixy, uint8_t* mac_addr) {
struct ixgbe_device* dev = IXY_TO_IXGBE(ixy);
uint32_t rar_high = get_reg32(dev->addr, IXGBE_RAH(0));
uint32_t rar_low = get_reg32(dev->addr, IXGBE_RAL(0));
uint16_t i;
for (i = 0; i < 4; i++)
mac_addr[i] = (uint8_t)(rar_low >> (i*8));
for (i = 0; i < 2; i++)
mac_addr[i+4] = (uint8_t)(rar_high >> (i*8));
}
quick and dirty, works for me, but I am noob so not sure how to implement it properly in ixy :)
Please add function to read MAC address of NIC