woking on linux kernel 5 yay

This commit is contained in:
carl 2023-06-07 20:14:44 -03:00
parent 52d8339f4b
commit 1f80d3ddec
4 changed files with 510 additions and 548 deletions

View File

@ -1,9 +1 @@
ACTION!="add",\ SUBSYSTEM=="usbmisc", KERNEL=="fjveincam*", ACTION=="add", MODE="0666", SYMLINK+="usb/fjveincam0"
DRIVERS=="fjveincam",\
MODE="0666",
SUBSYSTEM=="usb",\
ATTRS{idVendor}=="04c5",\
ATTRS{idProduct}=="1526",\
SYMLINK+="usb/fjveincam%n",\
RUN+="/bin/bash -c 'date >> /tmp/fjpv'",\
RUN+="/bin/bash -c 'echo $kernel _ $devpath _ $number id=$id MM=$major:$minor $name $sys >> /tmp/fjpv'"

View File

@ -3,6 +3,7 @@ make clean
make make
make install make install
cp fjveincam.ko /usr/lib/modules/`uname -r`/kernel/drivers/usb/misc/ cp fjveincam.ko /usr/lib/modules/`uname -r`/kernel/drivers/usb/misc/
cp 93-unicon-palmvene.rules /usr/lib/udev/rules.d/ #cp 93-unicon-palmvene.rules /usr/lib/udev/rules.d/
cp 93-unicon-palmvene.rules /etc/udev/rules.d/
insmod fjveincam.ko insmod fjveincam.ko
depmod depmod

View File

@ -14,9 +14,16 @@ int main(int argc, char ** argv) {
int status = 0; int status = 0;
int fd = 0; int fd = 0;
char fname[] = "/dev/usb/fjveincam\0\0"; char fname[] = "/dev/usb/fjveincam\0\0";
//char fname[] = "/dev/bus/usb//004/01\0\0";
char * p1 = fname; char * p1 = fname;
char * p2 = 0; char * p2 = 0;
if (argc<2){
printf("Error. Syntax is %s device# (eg 0,1,2)\n", argv[0]);
return 1;
}
memset(&info,1,sizeof(struct fjveincam_info)); memset(&info,1,sizeof(struct fjveincam_info));
p2 = argv[1]; p2 = argv[1];
*(p1+strlen(p1))=*p2; *(p1+strlen(p1))=*p2;
@ -46,7 +53,8 @@ int main(int argc, char ** argv) {
if (status < 0) { if (status < 0) {
perror("ioctl"); perror("ioctl");
printf("Failed to call function in kernel module with IOCTL code %lu\n",(unsigned long)USB_FJVEINCAMV30_IOCTL_CHECK,status); printf("Failed to call function in kernel module with IOCTL code %lu status %d\n",
(unsigned long)USB_FJVEINCAMV30_IOCTL_CHECK,status);
close(fd); close(fd);
return -1; return -1;
} }

1035
modules/fjpalmvein/C/fjpalmvein-main/fjveincam.c Normal file → Executable file

File diff suppressed because it is too large Load Diff