阅读:2000回复:1
请高人指点 :打开设备文件失败
struct my_device *my_open(
char *devname, unsigned char mode, int bufsize, char *filterstr ) { struct my_device *yd=NULL; struct signal_block sb; struct buffer_block bb; struct filter_block fb; int ret_val; yd = (struct my_device *)malloc(sizeof(struct my_device)); if(yd==NULL){ my_err_message("malloc error",__FILE__,__LINE__); return NULL; } // printf("In lines %d\n",__LINE__); yd->mode = mode; yd->fd = open(MY_FIREWALL,0); // printf("In lines %d\n",__LINE__); if(yd->fd<0){ printf("Can't Open device:\n"); my_err_message("Can't Open device\n",__FILE__,__LINE__); free(yd); return NULL; } insmod /usr/tmp/driver/myfilrewall.ko 安装成功,在设备列表中也可以看到,就是打开不成功,搞不定呀 |
|
沙发#
发布于:2007-08-14 03:58
windows驱动做久了,一下转到LIUNX上,真是一件非常痛苦的事,LIUNX前辈们也要支持支持呀
|
|