Need help: getting name address from ethernet address

Need help: getting name address from ethernet address

Post by Kim Richards » Sun, 06 Oct 1996 04:00:00



I am currently doing an assignment that decodes pdu's.
I have done all but obtain the name address of a host via an ethernet address
(in the 802.3 header)
I am use struct hostent *gethostbyaddr  to get the name address of via IP
but I dont know where to start with the ethernet address, only that I should be
using ARP to resolve the address , but I don't actually know the function or realated structures needed ...

pls email me if anybody can help me.....

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


Curtin University       http://student.curtin.edu.au/~erichardson
Perth, W.A, Australia
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


Curtin University       http://student.curtin.edu.au/~erichardson
Perth, W.A, Australia
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

 
 
 

1. YDL 1.2 Synergy VGM5 Virtual Address, Physical Address, Bus Address and remap_page_range (HELP!)

I am currently developing a kernel module to communicate with a PCI memory
device and I have run into a few problems.

1. How do I determine the physical address of my PCI device? I did examine
the IO-mapping.txt file in /usr/scr/linux and it states the following is
true for Power PC:

Physical Address: 0x0
Virtual Memory Address: 0xC0000000
Bus Address 0x80000000

Using lspci -v I find that the bus address of my device is as follows:
memory at 0xF0042100 non-prefectable
memory at 0xF1000000 prefetchable
memory at 0xF2000000 prefetchable

So how do I figure out the physical address for the bus address 0XF1000000
do I just subtract/add 0x80000000 to get the address?

2. I need the physical address because I am trying to obtain it to pass into
remap_page_range() (I need to map all of the memory from my PCI device into
kernel memory and then pass a pointer from the kernel to user space. I tried
using the value of 0x71000000 (which I obtained by subtracting 0x80000000
from 0xF1000000 and it doesn't work:
User mode application:

if( (fd = open( SCR_INT_DEV, O_RDWR )) == -1 )
             rvalue = DEVICE_ERROR;
        else
        {
            paddr = mmap( 0, 0x80000, prot, mmap_flags, fd, 0 );
            if( (int)paddr == -1 )
                rvalue = MAP_ERROR;

(mmap entry point in kernel module)

static int pci_mmap(struct file * file, struct vm_area_struct * vma)
 physical += vma->vm_offset;
  mapped_mem = vma->vm_end - vma->vm_start;

if (remap_page_range(vma->vm_start, 0x71000000, mapped_mem,
vma->vm_page_prot))

This works fine on a Linux 2.2.18 distribution running on an X86 (I
understand that on the Power PC that Phy addr and bus addr aren't the same)

I realize that this is a non-portable way of accessing memory, but our API
requires that it receive a user pointer to directly access memory from our
card. Can anyone please help me or point me to information that might help
me to solve the problem.

Thanks,

Chris Fought

2. How to enable I/O completion ports

3. How to get IP-address from the address name [edi]

4. Info needed for web sites selling used Sun Ultra systems

5. How to get default Gateway address, subnet address, DNS names using C/C++

6. Seg. fault trying to install Slack 3.0

7. can ping with number address but not with name address

8. IPC message passing in linux

9. Getting the physical address of a user virtual address.

10. Convert IP Name Address to Numeric Address

11. Ethernet Address and Broadcast Address Creation

12. ethernet addresses and IP addresses

13. Finding the ip address and hardware (ethernet) address of client behind a gateway