Hi all,

I am a new person particularly for developing drivers in linux-usb. Previously I have done the same for windows.

I wanted to write now a driver for my custom usb design. For that can I use this skeleton code what are the changes I have to in this so that I can know first loading the exe to kernel. How can I link this inserted module into the kernel to my board connected.

Pl give reply positively.

When I compiled directly the usb-skeleton code obtained I got the fallowing errors () the file is from linux kernel 2.4.18-14 redhat 8.0)

[EMAIL PROTECTED] root]# gcc -c -w Driver.c -I/usr/src/linux-2.4.18-14/include > error.doc
In file included from /usr/src/linux-2.4.18-14/include/linux/sched.h:14,
from Driver.c:3:
/usr/src/linux-2.4.18-14/include/linux/timex.h:173: field `time' has incomplete type
In file included from /usr/src/linux-2.4.18-14/include/linux/sched.h:86,
from Driver.c:3:
/usr/src/linux-2.4.18-14/include/linux/timer.h:17: field `list' has incomplete type
In file included from Driver.c:14:
/usr/src/linux-2.4.18-14/include/linux/devfs_fs_kernel.h:289: parse error before "devfs_alloc_devnum"
/usr/src/linux-2.4.18-14/include/linux/devfs_fs_kernel.h: In function `devfs_alloc_devnum':
/usr/src/linux-2.4.18-14/include/linux/devfs_fs_kernel.h:291: `NODEV' undeclared (first use in this function)
/usr/src/linux-2.4.18-14/include/linux/devfs_fs_kernel.h:291: (Each undeclared identifier is reported only once
/usr/src/linux-2.4.18-14/include/linux/devfs_fs_kernel.h:291: for each function it appears in.)
/usr/src/linux-2.4.18-14/include/linux/devfs_fs_kernel.h: At top level:
/usr/src/linux-2.4.18-14/include/linux/devfs_fs_kernel.h:294: parse error before "kdev_t"
Driver.c:43: elements of array `skel_table' have incomplete type
Driver.c:78: field `tqueue' has incomplete type
Driver.c:80: field `sem' has incomplete type
Driver.c:116: variable `skel_fops' has initializer but incomplete type
Driver.c:136: unknown field `owner' specified in initializer
Driver.c:138: unknown field `read' specified in initializer
Driver.c:139: unknown field `write' specified in initializer
Driver.c:140: unknown field `ioctl' specified in initializer
Driver.c:141: unknown field `open' specified in initializer
Driver.c:142: unknown field `release' specified in initializer
Driver.c:147: variable `skel_driver' has initializer but incomplete type
Driver.c:148: unknown field `name' specified in initializer
Driver.c:149: unknown field `probe' specified in initializer
Driver.c:150: unknown field `disconnect' specified in initializer
Driver.c:151: unknown field `fops' specified in initializer
Driver.c:152: unknown field `minor' specified in initializer
Driver.c:153: unknown field `id_table' specified in initializer
Driver.c: In function `usb_skel_debug_data':
Driver.c:170: `KERN_DEBUG' undeclared (first use in this function)
Driver.c:170: parse error before string constant
Driver.c: At top level:
Driver.c:199: conflicting types for `skel_open'
Driver.c:92: previous declaration of `skel_open'
Driver.c: In function `skel_open':
Driver.c:204: `KERN_DEBUG' undeclared (first use in this function)
Driver.c:204: parse error before string constant
Driver.c:204: parse error before ')' token
Driver.c:206: dereferencing pointer to incomplete type
Driver.c:220: `minor_table_mutex' undeclared (first use in this function)
Driver.c:238: dereferencing pointer to incomplete type
Driver.c: At top level:
Driver.c:251: conflicting types for `skel_release'
Driver.c:93: previous declaration of `skel_release'
Driver.c: In function `skel_release':
Driver.c:255: dereferencing pointer to incomplete type
Driver.c:257: `KERN_DEBUG' undeclared (first use in this function)
Driver.c:257: parse error before string constant
Driver.c:257: parse error before ')' token
Driver.c:261: parse error before string constant
Driver.c:261: parse error before ')' token
Driver.c:264: `minor_table_mutex' undeclared (first use in this function)
Driver.c:270: parse error before string constant
Driver.c:270: parse error before ')' token
Driver.c: At top level:
Driver.c:307: conflicting types for `skel_read'
Driver.c:89: previous declaration of `skel_read'
Driver.c: In function `skel_read':
Driver.c:311: dereferencing pointer to incomplete type
Driver.c:313: `KERN_DEBUG' undeclared (first use in this function)
Driver.c:313: parse error before string constant
Driver.c:313: parse error before ')' token
Driver.c: At top level:
Driver.c:349: conflicting types for `skel_write'
Driver.c:90: previous declaration of `skel_write'
Driver.c: In function `skel_write':
Driver.c:354: dereferencing pointer to incomplete type
Driver.c:356: `KERN_DEBUG' undeclared (first use in this function)
Driver.c:356: parse error before string constant
Driver.c:356: parse error before ')' token
Driver.c:369: parse error before string constant
Driver.c:369: parse error before ')' token
Driver.c:374: dereferencing pointer to incomplete type
Driver.c:375: parse error before string constant
Driver.c:375: parse error before ')' token
Driver.c:384: dereferencing pointer to incomplete type
Driver.c:391: dereferencing pointer to incomplete type
Driver.c:396: dereferencing pointer to incomplete type
Driver.c: At top level:
Driver.c:420: conflicting types for `skel_ioctl'
Driver.c:91: previous declaration of `skel_ioctl'
Driver.c: In function `skel_ioctl':
Driver.c:423: dereferencing pointer to incomplete type
Driver.c:435: `KERN_DEBUG' undeclared (first use in this function)
Driver.c:435: parse error before string constant
Driver.c:435: parse error before ')' token
Driver.c: In function `skel_write_bulk_callback':
Driver.c:453: dereferencing pointer to incomplete type
Driver.c:455: `KERN_DEBUG' undeclared (first use in this function)
Driver.c:455: parse error before string constant
Driver.c:455: parse error before ')' token
Driver.c:457: dereferencing pointer to incomplete type
Driver.c:458: dereferencing pointer to incomplete type
Driver.c:460: parse error before string constant
Driver.c:460: dereferencing pointer to incomplete type
Driver.c:460: parse error before ')' token
Driver.c: In function `skel_probe':
Driver.c:487: dereferencing pointer to incomplete type
[EMAIL PROTECTED] root]# gcc -c -w Driver.c -I/usr/src/linux-2.4.18-14/include
In file included from /usr/src/linux-2.4.18-14/include/linux/sched.h:14,
from Driver.c:3:
/usr/src/linux-2.4.18-14/include/linux/timex.h:173: field `time' has incomplete type
In file included from /usr/src/linux-2.4.18-14/include/linux/sched.h:86,
from Driver.c:3:
/usr/src/linux-2.4.18-14/include/linux/timer.h:17: field `list' has incomplete type
In file included from Driver.c:14:
/usr/src/linux-2.4.18-14/include/linux/devfs_fs_kernel.h:289: parse error before "devfs_alloc_devnum"
/usr/src/linux-2.4.18-14/include/linux/devfs_fs_kernel.h: In function `devfs_alloc_devnum':
/usr/src/linux-2.4.18-14/include/linux/devfs_fs_kernel.h:291: `NODEV' undeclared (first use in this function)
/usr/src/linux-2.4.18-14/include/linux/devfs_fs_kernel.h:291: (Each undeclared identifier is reported only once
/usr/src/linux-2.4.18-14/include/linux/devfs_fs_kernel.h:291: for each function it appears in.)
/usr/src/linux-2.4.18-14/include/linux/devfs_fs_kernel.h: At top level:
/usr/src/linux-2.4.18-14/include/linux/devfs_fs_kernel.h:294: parse error before "kdev_t"
Driver.c:43: elements of array `skel_table' have incomplete type
Driver.c:78: field `tqueue' has incomplete type
Driver.c:80: field `sem' has incomplete type
Driver.c:116: variable `skel_fops' has initializer but incomplete type
Driver.c:136: unknown field `owner' specified in initializer
Driver.c:138: unknown field `read' specified in initializer
Driver.c:139: unknown field `write' specified in initializer
Driver.c:140: unknown field `ioctl' specified in initializer
Driver.c:141: unknown field `open' specified in initializer
Driver.c:142: unknown field `release' specified in initializer
Driver.c:147: variable `skel_driver' has initializer but incomplete type
Driver.c:148: unknown field `name' specified in initializer
Driver.c:149: unknown field `probe' specified in initializer
Driver.c:150: unknown field `disconnect' specified in initializer
Driver.c:151: unknown field `fops' specified in initializer
Driver.c:152: unknown field `minor' specified in initializer
Driver.c:153: unknown field `id_table' specified in initializer
Driver.c: In function `usb_skel_debug_data':
Driver.c:170: `KERN_DEBUG' undeclared (first use in this function)
Driver.c:170: parse error before string constant
Driver.c: At top level:
Driver.c:199: conflicting types for `skel_open'
Driver.c:92: previous declaration of `skel_open'
Driver.c: In function `skel_open':
Driver.c:204: `KERN_DEBUG' undeclared (first use in this function)
Driver.c:204: parse error before string constant
Driver.c:204: parse error before ')' token
Driver.c:206: dereferencing pointer to incomplete type
Driver.c:220: `minor_table_mutex' undeclared (first use in this function)
Driver.c:238: dereferencing pointer to incomplete type
Driver.c: At top level:
Driver.c:251: conflicting types for `skel_release'
Driver.c:93: previous declaration of `skel_release'
Driver.c: In function `skel_release':
Driver.c:255: dereferencing pointer to incomplete type
Driver.c:257: `KERN_DEBUG' undeclared (first use in this function)
Driver.c:257: parse error before string constant
Driver.c:257: parse error before ')' token
Driver.c:261: parse error before string constant
Driver.c:261: parse error before ')' token
Driver.c:264: `minor_table_mutex' undeclared (first use in this function)
Driver.c:270: parse error before string constant
Driver.c:270: parse error before ')' token
Driver.c: At top level:
Driver.c:307: conflicting types for `skel_read'
Driver.c:89: previous declaration of `skel_read'
Driver.c: In function `skel_read':
Driver.c:311: dereferencing pointer to incomplete type
Driver.c:313: `KERN_DEBUG' undeclared (first use in this function)
Driver.c:313: parse error before string constant
Driver.c:313: parse error before ')' token
Driver.c: At top level:
Driver.c:349: conflicting types for `skel_write'
Driver.c:90: previous declaration of `skel_write'
Driver.c: In function `skel_write':
Driver.c:354: dereferencing pointer to incomplete type
Driver.c:356: `KERN_DEBUG' undeclared (first use in this function)
Driver.c:356: parse error before string constant
Driver.c:356: parse error before ')' token
Driver.c:369: parse error before string constant
Driver.c:369: parse error before ')' token
Driver.c:374: dereferencing pointer to incomplete type
Driver.c:375: parse error before string constant
Driver.c:375: parse error before ')' token
Driver.c:384: dereferencing pointer to incomplete type
Driver.c:391: dereferencing pointer to incomplete type
Driver.c:396: dereferencing pointer to incomplete type
Driver.c: At top level:
Driver.c:420: conflicting types for `skel_ioctl'
Driver.c:91: previous declaration of `skel_ioctl'
Driver.c: In function `skel_ioctl':
Driver.c:423: dereferencing pointer to incomplete type
Driver.c:435: `KERN_DEBUG' undeclared (first use in this function)
Driver.c:435: parse error before string constant
Driver.c:435: parse error before ')' token
Driver.c: In function `skel_write_bulk_callback':
Driver.c:453: dereferencing pointer to incomplete type
Driver.c:455: `KERN_DEBUG' undeclared (first use in this function)
Driver.c:455: parse error before string constant
Driver.c:455: parse error before ')' token
Driver.c:457: dereferencing pointer to incomplete type
Driver.c:458: dereferencing pointer to incomplete type
Driver.c:460: parse error before string constant
Driver.c:460: dereferencing pointer to incomplete type
Driver.c:460: parse error before ')' token
Driver.c: In function `skel_probe':
Driver.c:487: dereferencing pointer to incomplete type
Driver.c:488: dereferencing pointer to incomplete type
Driver.c:493: `minor_table_mutex' undeclared (first use in this function)
Driver.c:504: `GFP_KERNEL' undeclared (first use in this function)
Driver.c:512: dereferencing pointer to incomplete type
Driver.c:521: dereferencing pointer to incomplete type
Driver.c:522: dereferencing pointer to incomplete type
Driver.c:523: dereferencing pointer to incomplete type
Driver.c:525: dereferencing pointer to incomplete type
Driver.c:526: dereferencing pointer to incomplete type
Driver.c:528: dereferencing pointer to incomplete type
Driver.c:530: dereferencing pointer to incomplete type
Driver.c:538: dereferencing pointer to incomplete type
Driver.c:539: dereferencing pointer to incomplete type
Driver.c:546: dereferencing pointer to incomplete type
Driver.c:548: dereferencing pointer to incomplete type
Driver.c:556: dereferencing pointer to incomplete type
Driver.c:566: `USB_MAJOR' undeclared (first use in this function)
Driver.c: In function `skel_disconnect':
Driver.c:598: `minor_table_mutex' undeclared (first use in this function)
Driver.c: At top level:
Driver.c:116: storage size of `skel_fops' isn't known
Driver.c:147: storage size of `skel_driver' isn't known
[EMAIL PROTECTED] root]#


Regards,
Rajesh.K






-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger for complex code. Debugging C/C++ programs can leave you feeling lost and disoriented. TotalView can help you find your way. Available on major UNIX and Linux platforms. Try it free. www.etnus.com
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

Reply via email to