티스토리 뷰

I met this compile error, when I tried to build the old driver of Mediatek mt7612u at this link. http://www.mediatek.com/en/downloads1/downloads/


../../os/linux/rt_profile.c: In function ‘RTMPReadParametersHook’:
../../os/linux/rt_profile.c:198:25: error: ‘struct file’ has no member named ‘f_dentry’
      fsize = (ULONG)srcf->f_dentry->d_inode->i_size;


This compile error was occurred because the kernel version of my build machines is newer then the driver supports. So many kernel API, parameters of API and variables were changed but the driver could not be catched the newer kernel up. My kernel version of build machines are "3.13.0-32-generic" and "4.2.0-42-generic". And I guess you can realize how the driver already old to run on latest linux distro.


Anyway, if you want to just resolve this compile error only, then you can edit the source to resolve this compile error.


The original could be changed

#ifndef OS_ABL_SUPPORT
	// TODO: need to roll back when convert into OSABL code
	fsize = (ULONG)srcf->f_dentry->d_inode->i_size;
	if (buf_size < (fsize + 1))
		buf_size = fsize + 1;
#endif /* OS_ABL_SUPPORT */

like this.
#ifndef OS_ABL_SUPPORT
	// TODO: need to roll back when convert into OSABL code
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0))
	fsize = (ULONG)srcf->f_path.dentry->d_inode->i_size;
#else
	fsize = (ULONG)srcf->f_dentry->d_inode->i_size;
#endif
	if (buf_size < (fsize + 1))
		buf_size = fsize + 1;
#endif /* OS_ABL_SUPPORT */


YES. this code is from the driver of mt7612u Mediatek WiFi driver. But the important thing is you can avoid easily compile error using conditional directives with new kernel code wherever the source was from. You can check f_dentry(is just definition of f_path.dentry) was deprecated from kernel 3.19.0.


Please compare the source between 3.18.00 and 3.19.0.


fs.h header file in kernel 3.18.0, f_dentry is in the struct file.

http://lxr.free-electrons.com/source/include/linux/fs.h?v=3.18#L792


fs.h header file in kernel 3.19.0, f_dentry was gone in the struct file.

http://lxr.free-electrons.com/source/include/linux/fs.h?v=3.19#L810


But what you need to do first, when you met this error, is that to realize you need to update the source which you want to build. So contact your FAE or find the newer version of the source at google!
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함