diff options
author | Andreas Eversberg <andreas@eversberg.eu> | 2009-05-22 11:04:48 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-05-25 07:51:33 (GMT) |
commit | e73f6b2260daf02793071e5ce06ea87df762920a (patch) | |
tree | 5d5b2706a8a1c55d74a1488b083ad9253c03dc91 /drivers/isdn/mISDN/socket.c | |
parent | ba3af34ec9866dddac36c15947f867eb8e889bbc (diff) | |
download | linux-e73f6b2260daf02793071e5ce06ea87df762920a.tar.xz |
mISDN: Added layer-1-hold feature
Add IMHOLD_L1 ioctl.
The feature will be disabled on closing.
Signed-off-by: Andreas Eversberg <andreas@eversberg.eu>
Signed-off-by: Karsten Keil <keil@b1-systems.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/mISDN/socket.c')
-rw-r--r-- | drivers/isdn/mISDN/socket.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/isdn/mISDN/socket.c b/drivers/isdn/mISDN/socket.c index 508945d..530f68977 100644 --- a/drivers/isdn/mISDN/socket.c +++ b/drivers/isdn/mISDN/socket.c @@ -292,7 +292,7 @@ static int data_sock_ioctl_bound(struct sock *sk, unsigned int cmd, void __user *p) { struct mISDN_ctrl_req cq; - int err = -EINVAL, val; + int err = -EINVAL, val[2]; struct mISDNchannel *bchan, *next; lock_sock(sk); @@ -328,12 +328,27 @@ data_sock_ioctl_bound(struct sock *sk, unsigned int cmd, void __user *p) err = -EINVAL; break; } - if (get_user(val, (int __user *)p)) { + val[0] = cmd; + if (get_user(val[1], (int __user *)p)) { err = -EFAULT; break; } err = _pms(sk)->dev->teimgr->ctrl(_pms(sk)->dev->teimgr, - CONTROL_CHANNEL, &val); + CONTROL_CHANNEL, val); + break; + case IMHOLD_L1: + if (sk->sk_protocol != ISDN_P_LAPD_NT + && sk->sk_protocol != ISDN_P_LAPD_TE) { + err = -EINVAL; + break; + } + val[0] = cmd; + if (get_user(val[1], (int __user *)p)) { + err = -EFAULT; + break; + } + err = _pms(sk)->dev->teimgr->ctrl(_pms(sk)->dev->teimgr, + CONTROL_CHANNEL, val); break; default: err = -EINVAL; |