Find the answer to your Linux question:
Results 1 to 2 of 2
I am trying to compile the sources of examples of the book, Oreilly Linux Device Drivers on ubuntu which has the kernel version 2.6.24-24-rt installed on it. In particular, when ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2007
    Posts
    14

    [SOLVED] Examples of Linux Device Drivers Book


    I am trying to compile the sources of examples of the book, Oreilly Linux Device Drivers on ubuntu
    which has the kernel version 2.6.24-24-rt installed on it.

    In particular, when trying to compile snull (Network Device Drivers Examples), lots of errors prevent from the driver to get built.

    /home/ubuntu/sample-c/examples/snull/snull.c: In function ‘snull_poll’:
    /home/ubuntu/sample-c/examples/snull/snull.c:289: error: ‘struct net_device’ has no member named ‘quota’
    /home/ubuntu/sample-c/examples/snull/snull.c:289: warning: type defaults to ‘int’ in declaration of ‘_x’
    /home/ubuntu/sample-c/examples/snull/snull.c:289: error: ‘struct net_device’ has no member named ‘quota’
    /home/ubuntu/sample-c/examples/snull/snull.c:319: error: ‘struct net_device’ has no member named ‘quota’
    /home/ubuntu/sample-c/examples/snull/snull.c:321: error: too few arguments to function ‘netif_rx_complete’
    /home/ubuntu/sample-c/examples/snull/snull.c: In function ‘snull_napi_interrupt’:
    /home/ubuntu/sample-c/examples/snull/snull.c:406: error: too few arguments to function ‘netif_rx_schedule’
    /home/ubuntu/sample-c/examples/snull/snull.c: In function ‘snull_init’:
    /home/ubuntu/sample-c/examples/snull/snull.c:654: error: ‘struct net_device’ has no member named ‘rebuild_header’
    /home/ubuntu/sample-c/examples/snull/snull.c:655: error: ‘struct net_device’ has no member named ‘hard_header’
    /home/ubuntu/sample-c/examples/snull/snull.c:659: error: ‘struct net_device’ has no member named ‘poll’
    /home/ubuntu/sample-c/examples/snull/snull.c:660: error: ‘struct net_device’ has no member named ‘weight’
    /home/ubuntu/sample-c/examples/snull/snull.c:665: error: ‘struct net_device’ has no member named ‘hard_header_cache’
    make[2]: *** [/home/ubuntu/sample-c/examples/snull/snull.o] Error 1
    make[1]: *** [_module_/home/ubuntu/sample-c/examples/snull] Error 2
    make[1]: Leaving directory `/usr/src/linux-headers-2.6.24-24-rt'
    make: *** [default] Error 2

    Can someone help me fix the problem.

    The problem is because of the change in Kernel API, to the extent that even struct net_device has changed.

    So please do share with me if there is some kind of a patch to the examples code of the book, which will make the build successful.

    Or another solution is also welcome.

    Thanks in advance.

    Rajainnov

  2. #2
    Just Joined!
    Join Date
    Oct 2007
    Posts
    14
    I fixed this problem, the modified sources are available on cs.fsu.edu /2.6.25/ldd-examples/ website.

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •