已经有一个摄像头驱动,为了增加功能,准备用ioctl实现。 驱动里,fcap_ioctl函数用switch 根据cmd 来调用相应的功能实现函数。在应用软件里,用ioctl(fd,cmd,...)来调用。 在头文件 linux/videodev.h里,增加cmd的定义,用的是#define cmd ('v',30,struct ...) cmd是自己定义的命令表示 但是编译的时候就是报在应用软件程序里,cmd未定义。。。。。。。 刚接触linux驱动,请各位大侠指教
很简单的一段skull驱动程序 然后make之后却没有出现skull.ko 意思就是编译之后通过且没有报错,就是不出模块文件,请问哪位大侠知道原因不? 用同样的makefile 可以编译hello模块,也会出hello.ko模块,为什么这里却没有呢? 下面是编译结果: [root@Eric driver]# make make -C /lib/modules/2.6.9-5.ELsmp/build SUBDIRS=/root/workspace/driver modules make[1]: Entering directory `/usr/src/kernels/2.6.9-5.EL-smp-i686' ...
原文出处 http://www.lisoleg.net/lisoleg/applications/ioctl.htm linux ioctl() Primer Vipul Gupta In general an ioctl call in a user program looks like ioctl(int fd, int command, (char *) argstruct). For ioctl calls related to the networking code (these are the only ones we will deal with in this note), the file descriptor fd is actually a socket descriptor returned by the socket() system call. T...
我包含的头文件是这些
#include