aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/mISDN/socket.c
diff options
context:
space:
mode:
authorAndreas Eversberg <andreas@eversberg.eu>2009-05-22 07:04:48 -0400
committerDavid S. Miller <davem@davemloft.net>2009-05-25 03:51:33 -0400
commite73f6b2260daf02793071e5ce06ea87df762920a (patch)
tree5d5b2706a8a1c55d74a1488b083ad9253c03dc91 /drivers/isdn/mISDN/socket.c
parentba3af34ec9866dddac36c15947f867eb8e889bbc (diff)
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.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/isdn/mISDN/socket.c b/drivers/isdn/mISDN/socket.c
index 508945d1b9c1..530f68977361 100644
--- a/drivers/isdn/mISDN/socket.c
+++ b/drivers/isdn/mISDN/socket.c
@@ -292,7 +292,7 @@ static int
292data_sock_ioctl_bound(struct sock *sk, unsigned int cmd, void __user *p) 292data_sock_ioctl_bound(struct sock *sk, unsigned int cmd, void __user *p)
293{ 293{
294 struct mISDN_ctrl_req cq; 294 struct mISDN_ctrl_req cq;
295 int err = -EINVAL, val; 295 int err = -EINVAL, val[2];
296 struct mISDNchannel *bchan, *next; 296 struct mISDNchannel *bchan, *next;
297 297
298 lock_sock(sk); 298 lock_sock(sk);
@@ -328,12 +328,27 @@ data_sock_ioctl_bound(struct sock *sk, unsigned int cmd, void __user *p)
328 err = -EINVAL; 328 err = -EINVAL;
329 break; 329 break;
330 } 330 }
331 if (get_user(val, (int __user *)p)) { 331 val[0] = cmd;
332 if (get_user(val[1], (int __user *)p)) {
332 err = -EFAULT; 333 err = -EFAULT;
333 break; 334 break;
334 } 335 }
335 err = _pms(sk)->dev->teimgr->ctrl(_pms(sk)->dev->teimgr, 336 err = _pms(sk)->dev->teimgr->ctrl(_pms(sk)->dev->teimgr,
336 CONTROL_CHANNEL, &val); 337 CONTROL_CHANNEL, val);
338 break;
339 case IMHOLD_L1:
340 if (sk->sk_protocol != ISDN_P_LAPD_NT
341 && sk->sk_protocol != ISDN_P_LAPD_TE) {
342 err = -EINVAL;
343 break;
344 }
345 val[0] = cmd;
346 if (get_user(val[1], (int __user *)p)) {
347 err = -EFAULT;
348 break;
349 }
350 err = _pms(sk)->dev->teimgr->ctrl(_pms(sk)->dev->teimgr,
351 CONTROL_CHANNEL, val);
337 break; 352 break;
338 default: 353 default:
339 err = -EINVAL; 354 err = -EINVAL;