LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   riffa linux driver modification with round-robin scheduling (https://www.linuxquestions.org/questions/programming-9/riffa-linux-driver-modification-with-round-robin-scheduling-4175636245/)

promach 08-12-2018 09:33 PM

riffa linux driver modification with round-robin scheduling
 
For https://paste.ubuntu.com/p/FvgjPns75v/ , why am I having the following error: invalid use of undefined type ‘struct sched_param’ ? I have included sched.h

I am trying to make https://github.com/promach/riffa/blo....c#L1011-L1027 scheduled with round-robin policy

Note: For the riffa_driver.c, please refer to the ubuntu paste. This forum does not allow posting of long code.

Code:

phung@UbuntuHW15:~/Documents/fpga_overlay/riffa/driver/linux$ make clean && make debug
rm -Rf *.ko *.cmd *.o *.so *.so.* .*.cmd Module.symvers Module.markers modules.order *.mod.c .tmp_versions
Compiling driver for kernel: 4.17.4-041704-generic with the following values
    NAME: 'riffa'
  MAJNUM: '100'
VENDOR_ID0: '10EE'
VENDOR_ID1: '1172'

sed -i 's/#define MAJOR_NUM [^\n]*/#define MAJOR_NUM 100/g' riffa_driver.h
sed -i 's/#define DEVICE_NAME [^\n]*/#define DEVICE_NAME "riffa"/g' riffa_driver.h
sed -i 's/#define VENDOR_ID0 [^\n]*/#define VENDOR_ID0 0x10EE/g' riffa_driver.h
sed -i 's/#define VENDOR_ID1 [^\n]*/#define VENDOR_ID1 0x1172/g' riffa_driver.h
sed -i 's/#define DEBUG [^\n]*/#define DBUG 1/g' riffa_driver.h
sed -i 's/#define DBUG [^\n]*/#define DEBUG 1/g' riffa_driver.h
make -C /lib/modules/`uname -r`/build SUBDIRS=`pwd` modules
make[1]: Entering directory '/usr/src/linux-headers-4.17.4-041704-generic'
  CC [M]  /home/phung/Documents/fpga_overlay/riffa/driver/linux/riffa_driver.o
/home/phung/Documents/fpga_overlay/riffa/driver/linux/riffa_driver.c: In function ‘chnl_recv’:
/home/phung/Documents/fpga_overlay/riffa/driver/linux/riffa_driver.c:601:12: error: invalid use of undefined type ‘struct sched_param’
  recv_param.sched_priority = 1;
            ^
/home/phung/Documents/fpga_overlay/riffa/driver/linux/riffa_driver.c: In function ‘chnl_send’:
/home/phung/Documents/fpga_overlay/riffa/driver/linux/riffa_driver.c:831:12: error: invalid use of undefined type ‘struct sched_param’
  send_param.sched_priority = 1;
            ^
/home/phung/Documents/fpga_overlay/riffa/driver/linux/riffa_driver.c: At top level:
/home/phung/Documents/fpga_overlay/riffa/driver/linux/riffa_driver.c:133:27: error: storage size of ‘recv_param’ isn’t known
 static struct sched_param recv_param;
                          ^~~~~~~~~~
/home/phung/Documents/fpga_overlay/riffa/driver/linux/riffa_driver.c:134:27: error: storage size of ‘send_param’ isn’t known
 static struct sched_param send_param;
                          ^~~~~~~~~~
scripts/Makefile.build:312: recipe for target '/home/phung/Documents/fpga_overlay/riffa/driver/linux/riffa_driver.o' failed
make[2]: *** [/home/phung/Documents/fpga_overlay/riffa/driver/linux/riffa_driver.o] Error 1
Makefile:1577: recipe for target '_module_/home/phung/Documents/fpga_overlay/riffa/driver/linux' failed
make[1]: *** [_module_/home/phung/Documents/fpga_overlay/riffa/driver/linux] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.17.4-041704-generic'
Makefile:94: recipe for target 'riffa.ko' failed
make: *** [riffa.ko] Error 2
phung@UbuntuHW15:~/Documents/fpga_overlay/riffa/driver/linux$


astrogeek 08-14-2018 10:46 PM

Asking others to visit a third site and to review lengthy code just to understand your question is not a very effective way to get help - and not how things work here at LQ. Posting long code inline is not the solution either.

Please try to reduce your problem to a simplest example which clearly demonstrates the issue that you are having, and tell us what you have tried to solve the problem. Very often, you will find a solution in the process of doing so, which is the essence of troubleshooting any problem. If not, you will have reduced the problem to a simple code example which others can quickly understand and offer help.

Please review the Site FAQ for guidance in asking your questions, especially the link on that page, How to Ask Questions the Smart Way.

Remember that everyone here volunteers their time. Help others help you by asking simple, clear and complete questions that can be quickly understood without lengthy code review. You will then find many willing to stop by and help!


All times are GMT -5. The time now is 08:01 PM.