Title: eth_ioctl()
The actions of eth_ioctl(fd, req) depend on req, eth_ioctl()'s second parameter:
NWIOSETHOPT (NetWork IO Set ETHernet OPTions):
If req is NWIOSETHOPT, eth_ioctl() configures the ethernet file descriptor fd (eth_ioctl()'s first parameter), which can then be used by a higher layer (e.g., ip, arp).
NWIOGETHSTAT (NetWork IO Get ETHernet STATs):
Only the arp code calls eth_ioctl() with the second parameter set to NWIOGETHSTAT. In this case, the ap_ethaddr field of the arp port is set to the ethernet address of the ethernet file descriptor's underlying ethernet port.