LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-12-2018, 10:33 PM   #1
promach
LQ Newbie
 
Registered: Mar 2018
Posts: 8

Rep: Reputation: Disabled
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$
 
Old 08-14-2018, 11:46 PM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 4,800
Blog Entries: 6

Rep: Reputation: 2612Reputation: 2612Reputation: 2612Reputation: 2612Reputation: 2612Reputation: 2612Reputation: 2612Reputation: 2612Reputation: 2612Reputation: 2612Reputation: 2612
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!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RIFFA linux driver c coding question promach Programming 2 03-27-2018 10:46 AM
What is the minimum round robin scheduing interval supported by linux? cwang_sh Linux - Kernel 1 08-12-2014 09:12 PM
Scheduling through Round robin utkarshrawat Programming 3 05-16-2011 10:33 AM
Real-time Round-Robin Scheduling cttran Programming 2 05-06-2005 05:41 PM
Round Robin DNS Lucsi Linux - Software 1 07-18-2002 05:17 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration