1

I'm trying to figure out how I can read, write, and update memory addresses for eeprom on a pci network card using c language on ubuntu.

Can some please point me in the right direction to get started? Thank you

user1527227
  • 2,068
  • 5
  • 25
  • 36
  • @KRUKUSA I want to read/write/update to the eeprom memory on the pci board. – user1527227 Mar 18 '14 at 21:16
  • 1
    If I understand you correctly I would say that the answer lies in writing a linux/windows driver or using an existing one that allows you to do that. This will depend on what card you are talking about and you will probably be working very low level. – nonsensickle Mar 18 '14 at 21:25

1 Answers1

0

After some research, it appears ethtool can be used to read and write to the eeprom (http://manpages.ubuntu.com/manpages/hardy/en/man8/ethtool.8.html):

   ethtool -d|--register-dump ethX [raw on|off] [hex on|off] [file name]

   ethtool -e|--eeprom-dump ethX [raw on|off] [offset N] [length N]

   ethtool -E|--change-eeprom ethX [magic N] [offset N] [value N]

To dump eeprom, you can do ethtool -e ethX raw <on|off> offset <N> length <N>.

user1527227
  • 2,068
  • 5
  • 25
  • 36