]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/mISDNif.h
mISDN: Added an ioctl to change the device name
[linux-2.6-omap-h63xx.git] / include / linux / mISDNif.h
index 5c948f337817da7bb1386826d84f4e9f52e3d49a..be09476ed8549af2968065fdebd3525000311a95 100644 (file)
@@ -36,8 +36,8 @@
  *              - should be incremented on every checkin
  */
 #define        MISDN_MAJOR_VERSION     1
-#define        MISDN_MINOR_VERSION     0
-#define MISDN_RELEASE          18
+#define        MISDN_MINOR_VERSION     1
+#define MISDN_RELEASE          20
 
 /* primitives for information exchange
  * generell format
@@ -242,7 +242,8 @@ struct mISDNhead {
 #define TEI_SAPI               63
 #define CTRL_SAPI              0
 
-#define MISDN_CHMAP_SIZE       4
+#define MISDN_MAX_CHANNEL      127
+#define MISDN_CHMAP_SIZE       ((MISDN_MAX_CHANNEL + 1) >> 3)
 
 #define SOL_MISDN      0
 
@@ -254,16 +255,6 @@ struct sockaddr_mISDN {
        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 {
        unsigned char   major;
        unsigned char   minor;
@@ -275,11 +266,49 @@ struct mISDN_devinfo {
        u_int                   Dprotocols;
        u_int                   Bprotocols;
        u_int                   protocol;
-       u_long                  channelmap[MISDN_CHMAP_SIZE];
+       u_char                  channelmap[MISDN_CHMAP_SIZE];
        u_int                   nrbchan;
        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
+test_channelmap(u_int nr, u_char *map)
+{
+       if (nr <= MISDN_MAX_CHANNEL)
+               return map[nr >> 3] & (1 << (nr & 7));
+       else
+               return 0;
+}
+
+static inline void
+set_channelmap(u_int nr, u_char *map)
+{
+       map[nr >> 3] |= (1 << (nr & 7));
+}
+
+static inline void
+clear_channelmap(u_int nr, u_char *map)
+{
+       map[nr >> 3] &= ~(1 << (nr & 7));
+}
+
 /* CONTROL_CHANNEL parameters */
 #define MISDN_CTRL_GETOP               0x0000
 #define MISDN_CTRL_LOOP                        0x0001
@@ -290,6 +319,7 @@ struct mISDN_devinfo {
 #define MISDN_CTRL_SETPEER             0x0040
 #define MISDN_CTRL_UNSETPEER           0x0080
 #define MISDN_CTRL_RX_OFF              0x0100
+#define MISDN_CTRL_FILL_EMPTY          0x0200
 #define MISDN_CTRL_HW_FEATURES_OP      0x2000
 #define MISDN_CTRL_HW_FEATURES         0x2001
 #define MISDN_CTRL_HFC_OP              0x4000
@@ -405,7 +435,7 @@ struct mISDNdevice {
        u_int                   Dprotocols;
        u_int                   Bprotocols;
        u_int                   nrbchan;
-       u_long                  channelmap[MISDN_CHMAP_SIZE];
+       u_char                  channelmap[MISDN_CHMAP_SIZE];
        struct list_head        bchannels;
        struct mISDNchannel     *teimgr;
        struct device           dev;
@@ -430,7 +460,7 @@ struct mISDNstack {
 #endif
 };
 
-/* global alloc/queue dunctions */
+/* global alloc/queue functions */
 
 static inline struct sk_buff *
 mI_alloc_skb(unsigned int len, gfp_t gfp_mask)