[fedora-india] pci_request_regions not working

Giriprasad Deviprasad g_pr21 at yahoo.in
Fri Sep 9 10:52:20 UTC 2011

> To your question, the output says you are dereferencing a
> NULL pointer
> after calling rtl8139_get_stats(). Check your code
> initialization.

Thanks for the feedback, I have changed the function as follows, and it works:
static struct net_device_stats* rtl8139_get_stats(struct net_device *dev)
         struct rtl8139_private *tp;
         printk("rtl8139_get_stats is called\n");
         tp = netdev_priv(dev);
         return &tp->stats;
        //return 0;

Device enabled
Base 0  Starting Address = 9c00 End Address = 9cff  Length = 256
This Port is I/O mapped. It is NON Prefetchable.This is readable and writable.
Base 1  Starting Address = fdaff000 End Address = fdaff0ff  Length = 256
This Port is Memory mapped. It is NON Prefetchable. This is readable and writable.
rtl8139_init is called
rtl8139_init , initializing the structure struct net_device 
rtl8139_init exiting .........
Reading the PCI BAR registers 
Checking the PCI BAR registers for Memory mapped flag 
region is Memory mapped region
Calling pci_request_region 
Calling pci_set_master
Calling ioremap
Assigning ioaddress and length 
Assigning hardware address 
Assigning function address 
rtl8139_dev is not NULL
Calling register_netdev 
rtl8139_get_stats is called
AFTEr the call to register_netdev 
Init function exiting fine ...............
rtl8139_get_stats is called

More information about the india mailing list