LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices

Reply
 
Search this Thread
Old 01-12-2011, 09:40 AM   #1
laksh_vishnu
LQ Newbie
 
Registered: Jan 2011
Posts: 13

Rep: Reputation: 0
FPGA NIC MAC Address


Hi,

I have multiple FPGA NIC cards [Accelerator cards]. How can I access the Hardware address or MAC addresses of these cards usign driver code.

How can I read the MAc address of the device from ROM???
Can anyone guide me through?
 
Old 01-12-2011, 02:05 PM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,395
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
That would be NIC-specific. If there is an existing Linux driver for the NIC, you should be able to determine how to access the MAC ROM (assumig its done that way, and it usually is) from the driver code. There is a socket ioctl to acquire the MAC of an ethernet interface. The ifconfig source code has an example.
--- rod.
 
Old 01-17-2011, 10:19 AM   #3
laksh_vishnu
LQ Newbie
 
Registered: Jan 2011
Posts: 13

Original Poster
Rep: Reputation: 0
thank you rod...

can i access the mac address with the below specified info?

#define FLASH_BASE 0x38000
#define FLASH_REG_DATA (FLASH_BASE + 0x000)
#define FLASH_REG_ADDR (FLASH_BASE + 0x080)

a macro for reading the data from the the above mentioned locations - READL()

Can I directly go for READL(FLASH_REG_DATA) for accessing the mac address from the flash?

Kindly do guide me as I am new to this. Aplogies for any inconvenience.
 
Old 01-17-2011, 10:59 AM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,395
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
As I said before, how you read the MAC ROM is a feature of the specific make & model of the NIC. Your method may work for some certain type of NIC. From where did you get those specific numbers? Assuming those addresses are physical addresses, your code will/may only work in kernel space.
Are you asking how to write code to access the NIC's MAC ROM, how to write code to access the NIC's MAC, or simply how to get the MAC of a NIC? All three of these would be best handled in different ways.

--- rod.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Get MAC address of all NIC Johnny Ljunggren Linux - Networking 9 06-17-2008 07:34 AM
How to change the MAC address of an NIC card. vishnu_sreekumar Linux - Networking 2 01-04-2007 07:24 AM
modify nic mac-address mfran2002 Linux - Networking 4 10-19-2005 01:52 AM
changing nic mac address bishal Linux - Hardware 4 07-16-2004 04:44 PM
NIC gets different MAC address after each reboot?? BrianG Linux - Networking 1 04-09-2001 11:10 AM


All times are GMT -5. The time now is 06:48 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration