network packets and netif_rx()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
I'm having some problems in developing the receiving part of a ethernet 
driver. That's my first experience on a eth driver, so it could be a really 
dumb thing. 

My interrupt handler does exactly as said by 'LinuxNetworkInternals' and is 
similar to the dm9000 driver.
I'm testing all that stuff with ping and arp requests (and watching with 
wireshark what pass on the other side of the cable ;P )

I see that netif_rx() went called, and that the pointer to the packet 
contains the right values (ie: the dump of the memory coincides with the 
dump of the packet sent by another pc)

I see moreover that net_rx_action went called, so it seems everything's 
fine... but... i don't see any calls to my trasmittion function... 
I already make the start_xsmit() work, so it's not (or it seems to) this 
the cause.

The code that receive does something like that (cleaned out most of device 
dependent code):
          /* Get length if the packet... */
          rxlen = readw(db->rxbuf);
          reads = function(rxlen);
          if ((skb = dev_alloc_skb(rxlen)) != NULL) {
              skb->dev = dev;
              skb_reserve(skb, 2);
              rdptr = (u8 *) skb_put(skb, rxlen );
              for( count = 0 ; count < reads ; count ++ ){
                  u16 tmpbyte = readw( (void* __iomem)db->rxbuf );
                  rdptr[count] = tmpbyte & 0x00FF;
                  rdptr[count+1] = tmpbyte >> 8;
              }
          }
          /* Pass to upper layer */
          skb->protocol = eth_type_trans(skb, dev);
          netif_rx(skb);
          // ... updating stats structs...

Has someone any suggestion for me? 
Thanks in advance.
-- 
-gaspa-
-----------------------------------------------
-------- https://launchpad.net/~gaspa ---------
------ HomePage: iogaspa.altervista.org -------
-Il lunedi'dell'arrampicatore: www.lunedi.org -

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux