Hi, My system has an AT24 eeprom (drivers/misc/eeprom/at24.c), that contains the mac adress of my ethernet. Is there a standard way to retrieve data from other devices, that should be used inside drivers? I've already modified both at24.c and the ethernet driver to do so, but I'm wondering if there was already a better way. Thanks, bye! -- -gaspa- ----------------------------------------------- -------- https://launchpad.net/~gaspa --------- ----- HomePage: http://gaspa.yattaweb.it ------
Hi Andrea, first things first. What kernel version are you using?
Da: Andrea Gasparini <gaspa@yattaweb.it> Data: Fri, 25 Mar 2011 15:38:00 +0100 A: kernelnewbies@kernelnewbies.org Oggetto: mac address inside eeprom.
Hi, My system has an AT24 eeprom (drivers/misc/eeprom/at24.c), that contains the mac adress of my ethernet.
I looked at the latest version (2.6.38), and I saw that in include/linux/i2c/at24.h there is a structure to access the eeprom data. You should initialize that structure in your driver, or at boot, making it point to the eeprom address where the mac address is located.
Is there a standard way to retrieve data from other devices, that should be used inside drivers?
The standard way is always through the api's given in header files under the "include" directory.
I've already modified both at24.c and the ethernet driver to do so, but I'm wondering if there was already a better way.
Hope this is helping, Cheers Valentina
Thanks, bye! -- -gaspa- ----------------------------------------------- -------- https://launchpad.net/~gaspa --------- ----- HomePage: http://gaspa.yattaweb.it ------
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies>
Hi Valentina, In data venerdì 25 marzo 2011 17:22:58, Valentina Giusti ha scritto:
first things first. What kernel version are you using?
2.6.38, as you said, is perfect.
I looked at the latest version (2.6.38), and I saw that in include/linux/i2c/at24.h there is a structure to access the eeprom data. You should initialize that structure in your driver, or at boot, making it point to the eeprom address where the mac address is located.
Uhm. I'm not sure that's the same thing you're saying, but looking at the header file gives me an idea. So, probably the best way is using: void (*setup)(struct memory_accessor *, void *context); in my platform_device setup. So the setup code will be contained completely in the board-* file along with the other device specific setups. Cool :P
Hope this is helping,
Sure, thanks a lot. Bye. -- -gaspa- ----------------------------------------------- --------- http://launchpad.net/~gaspa --------- ------- HomePage: gaspa.yattaweb.it --------
participants (2)
-
Andrea Gasparini -
Valentina Giusti