Fix build errors on Linux 5.10

This commit is contained in:
brektrou
2020-12-18 14:42:01 +00:00
committed by GitHub
parent 2a3f9c0454
commit f273733d29

View File

@@ -1468,7 +1468,9 @@ u8 rtw_btcoex_sendmsgbysocket(_adapter *padapter, u8 *msg, u8 msg_size, bool for
{
u8 error;
struct msghdr udpmsg;
#ifdef set_fs
mm_segment_t oldfs;
#endif
struct iovec iov;
struct bt_coex_info *pcoex_info = &padapter->coex_info;
@@ -1498,15 +1500,19 @@ u8 rtw_btcoex_sendmsgbysocket(_adapter *padapter, u8 *msg, u8 msg_size, bool for
udpmsg.msg_control = NULL;
udpmsg.msg_controllen = 0;
udpmsg.msg_flags = MSG_DONTWAIT | MSG_NOSIGNAL;
#ifdef set_fs
oldfs = get_fs();
set_fs(KERNEL_DS);
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
error = sock_sendmsg(pcoex_info->udpsock, &udpmsg);
#else
error = sock_sendmsg(pcoex_info->udpsock, &udpmsg, msg_size);
#endif
#ifdef set_fs
set_fs(oldfs);
#endif
if (error < 0) {
RTW_INFO("Error when sendimg msg, error:%d\n", error);
return _FAIL;