aboutsummaryrefslogtreecommitdiff
path: root/drivers/isdn/mISDN/socket.c
diff options
context:
space:
mode:
authorMatthias Urlichs <smurf@smurf.noris.de>2008-08-12 10:12:09 +0200
committerKarsten Keil <kkeil@suse.de>2009-01-09 22:44:23 +0100
commit8b6015f736125050722dbe59c4f943e78cd626f0 (patch)
treea49553861b2b848c23306703c53b877a96a58624 /drivers/isdn/mISDN/socket.c
parent9776ef0829ed33e8f36d9e7d859d00cc91c54ffd (diff)
mISDN: Added an ioctl to change the device name
To get persistent device names with hotplug we need to rename devices sometime. Signed-off-by: Matthias Urlichs <matthias@urlichs.de> Signed-off-by: Karsten Keil <kkeil@suse.de>
Diffstat (limited to 'drivers/isdn/mISDN/socket.c')
-rw-r--r--drivers/isdn/mISDN/socket.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/isdn/mISDN/socket.c b/drivers/isdn/mISDN/socket.c
index 37a2de18cfd..98fa6c4a4bd 100644
--- a/drivers/isdn/mISDN/socket.c
+++ b/drivers/isdn/mISDN/socket.c
@@ -645,6 +645,21 @@ base_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
} else
err = -ENODEV;
break;
+ case IMSETDEVNAME:
+ {
+ struct mISDN_devrename dn;
+ if (copy_from_user(&dn, (void __user *)arg,
+ sizeof(dn))) {
+ err = -EFAULT;
+ break;
+ }
+ dev = get_mdevice(dn.id);
+ if (dev)
+ strlcpy(dev->name, dn.name, MISDN_MAX_IDLEN);
+ else
+ err = -ENODEV;
+ }
+ break;
default:
err = -EINVAL;
}