Thread (11 messages) 11 messages, 6 authors, 2012-10-29

Re: Information about napi_struct and net_device

flat view

From: Javier Domingo <hidden>
Date: 2012-10-29 11:50:12

Hi Francois,

I have been reading the code you recommended, and I think I must have
misexplained myself. I am not developing a driver, I am updating a
patch that we use at our research group, in which we modify linux to
make our custom packet processing, getting all the packets from the
NICs into a custom queue for processing.

It will obviously not going to be integrated in the linux kernel,
because its way to work is just useful to us, thought when we have
something that works, we have planned to distribute it.

I work with net_device, because I mainly use its fields, but I provide
functions to enable/disable capturing from a specific net_device. Now,
as napi_struct has appeared, I can't no longer use the
netif_rx_disable/enable functions, but I still need to know how to get
the already created napi_struct from my net_device pointers.

I think I have been looking in a too low level,

Regards,

Javier Domingo


2012/10/29 Francois Romieu [off-list ref]:
Javier Domingo [off-list ref] :
[...]
quoted
              inside of the net_device structure, I know I can take
the net_device pointer as documented in [3], but how may  I obtain the
napi_struct from the netdevice? or I am doing it the wrong way?
You are doing it the wrong way. The napi_struct you need is not embedded
here. See

$ less +/napi drivers/net/ethernet/realtek/8139cp.c

(first match in struct cp_private).

You should really read one of the existing drivers.

--
Ueimor
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help