Skip to content

Commit

Permalink
Fix build on 5.2.0-rc6 kernel.
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Greear <greearb@candelatech.com>
  • Loading branch information
greearb committed Jun 24, 2019
1 parent 53888de commit 77f162d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
4 changes: 3 additions & 1 deletion os_dep/linux/os_intfs.c
Expand Up @@ -694,8 +694,10 @@ static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb
, void *accel_priv
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,2,0)
, select_queue_fallback_t fallback
#endif
#endif

#endif
)
Expand Down Expand Up @@ -811,7 +813,7 @@ static const struct net_device_ops rtw_netdev_ops = {
.ndo_open = netdev_open,
.ndo_stop = netdev_close,
.ndo_start_xmit = rtw_xmit_entry,
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
.ndo_select_queue = rtw_select_queue,
#endif
.ndo_set_mac_address = rtw_net_set_mac_address,
Expand Down
7 changes: 6 additions & 1 deletion os_dep/linux/rtw_android.c
Expand Up @@ -600,7 +600,12 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
goto exit;
}

if (!access_ok(VERIFY_READ, priv_cmd.buf, priv_cmd.total_len)) {
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,2,0)
if (!access_ok(VERIFY_READ, priv_cmd.buf, priv_cmd.total_len))
#else
if (!access_ok(priv_cmd.buf, priv_cmd.total_len))
#endif
{
DBG_871X("%s: failed to access memory\n", __FUNCTION__);
ret = -EFAULT;
goto exit;
Expand Down
6 changes: 3 additions & 3 deletions os_dep/osdep_service.c
Expand Up @@ -1945,7 +1945,7 @@ static int isFileReadable(char *path)
ret = PTR_ERR(fp);
} else {
oldfs = get_fs();
set_fs(get_ds());
set_fs(KERNEL_DS);

if(1!=readFile(fp, &buf, 1))
ret = PTR_ERR(fp);
Expand Down Expand Up @@ -1974,7 +1974,7 @@ static int retriveFromFile(char *path, u8* buf, u32 sz)
DBG_871X("%s openFile path:%s fp=%p\n",__FUNCTION__, path ,fp);

oldfs = get_fs();
set_fs(get_ds());
set_fs(KERNEL_DS);
ret=readFile(fp, buf, sz);
set_fs(oldfs);
closeFile(fp);
Expand Down Expand Up @@ -2009,7 +2009,7 @@ static int storeToFile(char *path, u8* buf, u32 sz)
DBG_871X("%s openFile path:%s fp=%p\n",__FUNCTION__, path ,fp);

oldfs = get_fs();
set_fs(get_ds());
set_fs(KERNEL_DS);
ret=writeFile(fp, buf, sz);
set_fs(oldfs);
closeFile(fp);
Expand Down

0 comments on commit 77f162d

Please sign in to comment.