open-sdr / openwifi

open-source IEEE 802.11 WiFi baseband FPGA (chip) design: driver, software
GNU Affero General Public License v3.0
3.83k stars 647 forks source link

driver #281

Closed kebZhang closed 1 year ago

kebZhang commented 1 year ago

Hello,I want to use some function of driver/tx_intf/tx_intf.c in my own user space function. Are there any methods other than adding system calls?

kebZhang commented 1 year ago

I want to use reg_write function of the tx_intf.ko so I change the syscall_32.tbl、sys.c、syscalls.h to add the system call of reg_write in my own computer. And then I use the instruction of update driver(./make_all.sh $XILINX_DIR 32). But it didn't work.

kebZhang commented 1 year ago

I try to add a system call into kernel but I failed. I build a directory 'mychange' below adi-linux and build mychange.c to define the function and wrote 'obj-y = mychang.o' in Makefile below 'mychange'. I also add 'mychange' into Makefile below the adi-linux. I wrote new number '385 i386 mychange sys_mychange' in syscall_32.tbl and I declare the function in adi-linux/include/uapi/asm-generic/unistd.h. But I can't use this system call in my userspace function. Can you help me?

JiaoXianjun commented 1 year ago

you need to learn the code related to sdrctl or sysfs: https://github.com/open-sdr/openwifi/blob/master/driver/sdrctl_intf.c https://github.com/open-sdr/openwifi/blob/master/driver/sysfs_intf.c You can also search sdrctl in the issues. Some others have implemented via this userspace kernel communication channel.

kebZhang commented 1 year ago

Thank you very much, I have implemented this via sysfs.