modifying ethernet driver - advice needed

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

Reply to
john.maximus
Loading thread data ...

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

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

--

Tauno Voipio
tauno voipio (at) iki fi
Reply to
Tauno Voipio

OOPS: The group is comp.systems.arm.

TV

Reply to
Tauno Voipio

So it's an ethernet driver.

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.

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 ?

What "upper layer" ?

Linux Device Drivers

formatting link
explains this quite well.

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.

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

Why ? What is the use case ?

Reply to
Geronimo W. Christ Esq

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

Ger>

Reply to
john.maximus

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.

Reply to
Geronimo W. Christ Esq

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.