Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

various build fixes with more current kernels #7

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion drivers/isdn/mISDN/octvqe/octvqe_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -718,12 +718,21 @@ static ssize_t octdev_read(

add_wait_queue(&pChan->ReadWaitQueue, &WaitQ);

#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0))
current->state = TASK_INTERRUPTIBLE;
#else
WRITE_ONCE(current->__state, TASK_INTERRUPTIBLE);
#endif

if (!signal_pending(current))
schedule();

#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0))
current->state = TASK_RUNNING;
#else
WRITE_ONCE(current->__state, TASK_RUNNING);
#endif

remove_wait_queue(&pChan->ReadWaitQueue, &WaitQ);

if (signal_pending(current))
Expand Down Expand Up @@ -843,12 +852,21 @@ static ssize_t octdev_write(

add_wait_queue(&pChan->WriteWaitQueue, &WaitQ);

#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0))
current->state = TASK_INTERRUPTIBLE;
#else
WRITE_ONCE(current->__state, TASK_INTERRUPTIBLE);
#endif

if (!signal_pending(current))
schedule();

#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0))
current->state = TASK_RUNNING;
#else
WRITE_ONCE(current->__state, TASK_RUNNING);
#endif

remove_wait_queue(&pChan->WriteWaitQueue, &WaitQ);

if (signal_pending(current))
Expand Down Expand Up @@ -1208,4 +1226,3 @@ module_exit(octvqe_exit);
MODULE_AUTHOR("Octasic Inc.");
MODULE_DESCRIPTION("OCTVQE echo canceller");
MODULE_LICENSE("GPL");
MODULE_SUPPORTED_DEVICE(DEV_NAME);
8 changes: 4 additions & 4 deletions drivers/isdn/mISDN/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ data_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
}

static int data_sock_setsockopt(struct socket *sock, int level, int optname,
char __user *optval, unsigned int len)
sockptr_t optval, unsigned int len)
{
struct sock *sk = sock->sk;
int err = 0, opt = 0;
Expand All @@ -417,7 +417,7 @@ static int data_sock_setsockopt(struct socket *sock, int level, int optname,

switch (optname) {
case MISDN_TIME_STAMP:
if (get_user(opt, (int __user *)optval)) {
if (copy_from_sockptr(&opt, optval, sizeof(int))) {
err = -EFAULT;
break;
}
Expand Down Expand Up @@ -741,8 +741,8 @@ static const struct proto_ops base_sock_ops = {
.recvmsg = sock_no_recvmsg,
.listen = sock_no_listen,
.shutdown = sock_no_shutdown,
.setsockopt = sock_no_setsockopt,
.getsockopt = sock_no_getsockopt,
.setsockopt = NULL,
.getsockopt = NULL,
.connect = sock_no_connect,
.socketpair = sock_no_socketpair,
.accept = sock_no_accept,
Expand Down
1 change: 0 additions & 1 deletion include/linux/mISDNif.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#ifndef mISDNIF_H
#define mISDNIF_H

#include <stdarg.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/socket.h>
Expand Down