diff options
author | Matthias Urlichs <smurf@smurf.noris.de> | 2008-08-12 04:12:09 -0400 |
---|---|---|
committer | Karsten Keil <kkeil@suse.de> | 2009-01-09 16:44:23 -0500 |
commit | 8b6015f736125050722dbe59c4f943e78cd626f0 (patch) | |
tree | a49553861b2b848c23306703c53b877a96a58624 /drivers | |
parent | 9776ef0829ed33e8f36d9e7d859d00cc91c54ffd (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')
-rw-r--r-- | drivers/isdn/mISDN/socket.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/isdn/mISDN/socket.c b/drivers/isdn/mISDN/socket.c index 37a2de18cfd0..98fa6c4a4bd6 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) | |||
645 | } else | 645 | } else |
646 | err = -ENODEV; | 646 | err = -ENODEV; |
647 | break; | 647 | break; |
648 | case IMSETDEVNAME: | ||
649 | { | ||
650 | struct mISDN_devrename dn; | ||
651 | if (copy_from_user(&dn, (void __user *)arg, | ||
652 | sizeof(dn))) { | ||
653 | err = -EFAULT; | ||
654 | break; | ||
655 | } | ||
656 | dev = get_mdevice(dn.id); | ||
657 | if (dev) | ||
658 | strlcpy(dev->name, dn.name, MISDN_MAX_IDLEN); | ||
659 | else | ||
660 | err = -ENODEV; | ||
661 | } | ||
662 | break; | ||
648 | default: | 663 | default: |
649 | err = -EINVAL; | 664 | err = -EINVAL; |
650 | } | 665 | } |