Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getHardwareAddress



On May 14, 2007, at 9:31 PM, sugumaran Narayanan wrote:

In my PCCard driver, which I have written based on a PCI driver, calling the attachinterface() calls the gethardwareaddress(). In my device the mac address is brought to a hw register only when a reset occurs and when the hardware interrupts are enabled. so when the gethardwareaddress() gets called, I dont have the right mac address to return. Is there any way to return the right mac addres to the upper layers, later, when the device starts generating interrupts. 

You can return kIOReturnNotReady from getHardwareAddress().  If you call attachInterface(&interface, false) then the service will be initialized but not registered.  After you have prepared the hardware, call publishProperties() which will get the MAC address, and then interface->registerService();  This will delay the appearance of your interface to the system until the hardware is ready.  You can also return  0.0.0.0 if no address is available, and then manually set the address property in your enable() function using setProperty(kIOMACAddress,  (void *)&addr, kIOEthernetAddressSize).  You can force a refresh of the MAC address by calling detachFromDataLinkLayer and then attachToDataLinkLayer on the interface.
-- 
Shaun Wexler
MacFOH

Ethernet \'ethur`net\, n. something used to catch the etherbunny.



Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-drivers mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-drivers/email@hidden

This email sent to email@hidden

References: 
 >getHardwareAddress (From: "sugumaran Narayanan" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.