Re: problem with registering net_dev

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

 



Thanks. I think then thats the problem. I am running 2.6.20 got from ubuntu installation. But my module is compiled against 2.6.20 got from kernel.org. Though simple module containing just printk works fine with my existing setup itself.

On 7/4/07, pradeep singh <2500.pradeep@xxxxxxxxx> wrote:
On 7/5/07, Rajat Jain <Rajat.Jain@xxxxxxxxxxxx> wrote:
>
> Hi Prasad,
>
> The running kernel version has to EXACTLY match with the kernel source tree that you are compiling your module against. This includes the EXTRA_VERSION information in the makefile. For e.g, a running "2.6.9-5.EL" (Redhat) kernel won't be able to load a module compiled against 2.6.9.
>
> Also, I think (but I'm not sure) that the compiler must be the same that was used in compiling the kernel. Can somebody please confirm this?
Yes, it has to be same.
>
> Thanks,
>
> Rajat
>
>
> -----Original Message-----
> From: kernelnewbies-bounce@xxxxxxxxxxxx [mailto:kernelnewbies-bounce@xxxxxxxxxxxx]On Behalf Of prasad hegde
> Sent: Thursday, July 05, 2007 7:05 AM
> To: kernelnewbies
> Subject: problem with registering net_dev
>
>
> Hi,
>
> I am a newbie trying to learn working of network device.
> I was trying a stripped down version of snull.c example in ldd3
>
> I am not able to load the module.
>
> dmesg says
>
>  net_drive: disagrees about version of symbol alloc_netdev
>  net_drive: Unknown symbol alloc_netdev
>
> Even though I am running 2.6.20 and my code is also compiled against 2.6.20, they both are different kernels.
> Is this a problem, I dont think so.
>
> My relevant code snippet is
>
> int snull_init_module(void)
> {
>         int result, i, ret = -ENOMEM;
>
>          /* Allocate the devices */
>         snull_devs[0] = alloc_netdev(sizeof(struct snull_priv), "sn%d",
>                         snull_init);
>         snull_devs[1] = alloc_netdev(sizeof(struct snull_priv), "sn%d",
>                         snull_init);
>         if (snull_devs[0] == NULL || snull_devs[1] == NULL)
>                 goto out;
>
>    out:
>         if (ret)
>            return ret;
> }
>
> void snull_init(struct net_device *dev )
> {
>         return;
> }
>
> module_init(snull_init_module);
>
>
> Any help or pointers are appreciated.
>
> Thanks
> Prasad.
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>


--
play the game


[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