I can’t seem to get the below code to work. Any suggestions?
How do I print out the nicconfig.permanent_address variable?
devctl(fd, DCMD_IO_NET_GET_CONFIG, &nicconfig, sizeof(nicconfig), NULL);
I also tried using this function but it always fails to print the mac and goes
i do not even have the nic_config_t anywhere. I guess there is the advanced networking package necessary?
So i actually found nic_info_t, but fd seems to be -1, so open fails on /dev/io-net/en0
Reading carefully points out:
now I feel embarrassed
But then why doesn’t the nic_get_syspage_mac work?
The nic_get_syspage_mac will only work, if someone (that’d be you added the mac into the syspage
If you didn’t do that, then it won’t be there.
The purpose of this, is for embedded devices where the embedded ethernet mac, does not come with a ROM with a mac address on it. The embedded developer is supposed to figure out (in the startup) what the mac addr is and then write it into the syspage. The driver will then read the mac from the syspage (usually there is a “syspage” option to the driver to tell it to do this).
I see, I thought all other drivers also wrote to the syspage. So then, when I run the nicinfo or pci -v util, where does it get its information from not from syspage??