modifying ethernet driver - advice needed

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hi,
   We have an kernel app (or code which runs only in the kernel).

 I dont want to use the networking code of the linux kernel.

  I just want to call the linux network device driver functions from my
code (say some character driver).

Actually, the driver is not a character driver in the true sense.

It actually sends and recieves network packets (Only Ethernet Packets)
No TCP/IP.


But I think the ethernet driver is closely coupled with the networking
code of linux.

I dont have any ethernet driver running on my system.

On my system only my driver will send and recieve packets (enet) over
the network.

I tried modifying the enet code. but i dont know what the upper layer
passes to each of the driver functions.

It passes some device and net_device structures and i dont know what
values these contain when it passes to the lower driver layer and what
modifications the upper layer do to these data structures.

I know the base address and irq


I am using smc91x.c linux driver.


I need your advice in this regard. how can i solve and resolve my
problem and how do i go about it.

The reason why i want to do it is time. sending/recieving the packets
must be very fast (very high performance sensitive).


Regards,
John


Re: modifying ethernet driver - advice needed
Quoted text here. Click to load it

I responded to your question in comp.arch.embedded.

<rant>
If you have to post into multiple groups, please cross-post
instead of separate posts, so the responses stay connected.
</rant>

--

Tauno Voipio
tauno voipio (at) iki fi


Re: modifying ethernet driver - advice needed
Quoted text here. Click to load it

   OOPS: The group is comp.systems.arm.

TV

Quoted text here. Click to load it


Re: modifying ethernet driver - advice needed

Quoted text here. Click to load it

So it's an ethernet driver.

Quoted text here. Click to load it

It does not have to be. There are routines that make it a lot easier to
couple to Linux's IP stack, but you don't have to call them.

Quoted text here. Click to load it

An ethernet driver is a bit of code which sends and receives ethernet
packets. Since this is what your code does, therefore it is an ethernet
driver.

What is it you are trying to do ? You're sending and receiving the
packets. Where are you getting the packet data to send, and what do you
want to do with the packet data you receive ?

Quoted text here. Click to load it

What "upper layer" ?

Quoted text here. Click to load it

Linux Device Drivers (http://www.xml.com/ldd/chapter/book /) explains
this quite well.

Quoted text here. Click to load it

We don't know much about what your problem actually is. You seem to be
trying to modify an ethernet driver, but other than saying that you
don't want to use TCP/IP you haven't given much info.

Quoted text here. Click to load it

The reason why you want to do .. what exactly ?

Quoted text here. Click to load it

Why ? What is the use case ?




Re: modifying ethernet driver - advice needed
Hi,
   Thanks for your response. here r the clarifications i am giving to
understand my problem.

OK. I dont want a standalone ethernet driver.

mine is a kernel level app. I dont want to use the networking code in
linux.

I just want to call the functions of the ethernet driver.


Right now, some one else is calling the ethernet driver (Say IP).

He must be passing some data structures which contain some values to
different functions of ethernet driver.

I dont know what the values are passed by the caller (some procedure in
upper layer to ethernet driver) to the ethernet driver.

I want to know what those are ?.


He passes 2 data structure struct device and struct net_device - i dont
know what values in these datastructures are modified by the upper
layer procedure defnition.



Regards,
John

Geronimo W. Christ Esq wrote:
Quoted text here. Click to load it


Re: modifying ethernet driver - advice needed

Quoted text here. Click to load it

OK, you're doing some weird and wonderful kernel hacking. I suggest you
do the obvious thing, and look at the kernel sources. That way you'll be
able to determine what the code is doing and modify it to your
requirements.

Site Timeline