Commit 8b6015f7 authored by Matthias Urlichs's avatar Matthias Urlichs Committed by Karsten Keil

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: default avatarMatthias Urlichs <matthias@urlichs.de>
Signed-off-by: default avatarKarsten Keil <kkeil@suse.de>
parent 9776ef08
...@@ -645,6 +645,21 @@ base_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -645,6 +645,21 @@ base_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
} else } else
err = -ENODEV; err = -ENODEV;
break; 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: default:
err = -EINVAL; err = -EINVAL;
} }
......
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
* - should be incremented on every checkin * - should be incremented on every checkin
*/ */
#define MISDN_MAJOR_VERSION 1 #define MISDN_MAJOR_VERSION 1
#define MISDN_MINOR_VERSION 0 #define MISDN_MINOR_VERSION 1
#define MISDN_RELEASE 19 #define MISDN_RELEASE 20
/* primitives for information exchange /* primitives for information exchange
* generell format * generell format
...@@ -255,16 +255,6 @@ struct sockaddr_mISDN { ...@@ -255,16 +255,6 @@ struct sockaddr_mISDN {
unsigned char tei; unsigned char tei;
}; };
/* timer device ioctl */
#define IMADDTIMER _IOR('I', 64, int)
#define IMDELTIMER _IOR('I', 65, int)
/* socket ioctls */
#define IMGETVERSION _IOR('I', 66, int)
#define IMGETCOUNT _IOR('I', 67, int)
#define IMGETDEVINFO _IOR('I', 68, int)
#define IMCTRLREQ _IOR('I', 69, int)
#define IMCLEAR_L2 _IOR('I', 70, int)
struct mISDNversion { struct mISDNversion {
unsigned char major; unsigned char major;
unsigned char minor; unsigned char minor;
...@@ -281,6 +271,23 @@ struct mISDN_devinfo { ...@@ -281,6 +271,23 @@ struct mISDN_devinfo {
char name[MISDN_MAX_IDLEN]; char name[MISDN_MAX_IDLEN];
}; };
struct mISDN_devrename {
u_int id;
char name[MISDN_MAX_IDLEN]; /* new name */
};
/* timer device ioctl */
#define IMADDTIMER _IOR('I', 64, int)
#define IMDELTIMER _IOR('I', 65, int)
/* socket ioctls */
#define IMGETVERSION _IOR('I', 66, int)
#define IMGETCOUNT _IOR('I', 67, int)
#define IMGETDEVINFO _IOR('I', 68, int)
#define IMCTRLREQ _IOR('I', 69, int)
#define IMCLEAR_L2 _IOR('I', 70, int)
#define IMSETDEVNAME _IOR('I', 71, struct mISDN_devrename)
static inline int static inline int
test_channelmap(u_int nr, u_char *map) test_channelmap(u_int nr, u_char *map)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment