• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Get mac address of physical NIC card from firmware
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Get mac address of physical NIC card from firmware


  • Subject: Re: Get mac address of physical NIC card from firmware
  • From: Dmitriy Skorodumov <email@hidden>
  • Date: Sun, 01 May 2011 15:18:33 +0400

Hi

afaik  it  is  not  possible  to dump EEPROM of generic device.. but I
thought  that  it  every device has its own format of EEPROM, so I see
no use for this anyway

About  obtaining  PCI  VendorId/Device ID for interface, I think it is
worth to dig the ioreg sources:
http://www.opensource.apple.com/source/IOKitTools/IOKitTools-78/ioreg.tproj/

(from command line "ioreg  -c IOPCIDevice")

--
WBR
 Dmitriy                            mailto:email@hidden

Saturday, April 30, 2011, 4:55:14 PM, you wrote:



Thanks Dmitriy,

Most of requirements are solved. Only two things are left.
1. Vendor-Id, Device-Id
2. Mac address from EEPROM

Both of these can be solved if we can dump/read the EEPROM data from interface
hardware.
How do I dump/read this data for a particular interface? for example "en0"

Prashant



----- Original Message ----
From: Dmitriy Skorodumov <email@hidden>
To: Prashant Saxena <email@hidden>
Sent: Thu, 28 April, 2011 2:27:10 PM
Subject: Re: Get mac address of physical NIC card from firmware

Hi

> 3. How do I differentiate between wired and wireless(airport) adapter?

bool is_wifi(const char *ifname) {

ifmediareq ifmr;
int s = ::socket(AF_INET, SOCK_DGRAM, 0);
memset(&ifmr, 0, sizeof(ifmr));
strcpy(ifmr.ifm_name, ifname);
ioctl(s, SIOCGIFMEDIA, &ifmr);
close(s);
return (0 != (ifmr.ifm_current & IFM_IEEE80211));

}

--
WBR,
Dmitriy                            mailto:email@hidden

Wednesday, April 27, 2011, 4:43:28 PM, you wrote:

Hi,

I made this new tool to get various info of all the ethernet adapters available.


The source code as well as an executable is attached here with. I have few
questions:

1. For compiling and linking, I am using simple "gcc macinfo.c -macinfo"
command. I am on Intel and I need to make this tool
universal(support on both architecture (Intel and PPC) as well as support for
64Bit). What additional flags I have to specify to do so?

2. On linux platform to get the the name of the adapter (device name) and it's
vendor, I am reading byte code of device name and it's vendor name from various
files in /sys/class/net/<adapter> directory. Later this byte code is matched
using pci.ids file.
How do I get these byte codes of vendor and device name on os x?

3. How do I differentiate between wired and wireless(airport) adapter?

4. On linux, I am using 'ethtool' api to get the mac address from firmware. How
do I get mac address on mac from firmware?
I have no idea if 'ethtool' api is going to work or not? Any thing specific on
Mac?

Finally I am requesting to users of this list to do couple of simple tests and
let me know the output produced. I don't have Mac
hardware with wireless adapter although I am planning to buy a Mac mini
shortly...;-)

Make sure that you have a machine with two adapters, wired and wireless. If you
have any virtual adapters installed then it would
be an added advantage.

1. Make wired adapter active and run the tool
2. Disable wired adapter and active wireless(airport) adapter and run the tool
again.

Check in both cases;
a) Is it showing the adapter which is not active?
b) Order of adapters info is always same or it's getting changed based on
current connection?
c) Is it showing virtual adapters also?
d) What's the value of 'physical' field in output when adapter is virtual?
e) What's the value of 'physical' field in output when adapter is wired or
wireless?

I would really appreciate if some one can do these tests and send me the
updates.

Best Regards

Prashant

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Fw: Get mac address of physical NIC card from firmware
      • From: Prashant Saxena <email@hidden>
  • Next by Date: Fw: Get mac address of physical NIC card from firmware
  • Next by thread: Fw: Get mac address of physical NIC card from firmware
  • Index(es):
    • Date
    • Thread