patch-2.1.92 linux/include/linux/isdnif.h
Next file: linux/include/linux/lists.h
Previous file: linux/include/linux/isdn_ppp.h
Back to the patch index
Back to the overall index
- Lines: 296
- Date:
Wed Apr 1 16:20:56 1998
- Orig file:
v2.1.91/linux/include/linux/isdnif.h
- Orig date:
Mon Nov 3 10:08:48 1997
diff -u --recursive --new-file v2.1.91/linux/include/linux/isdnif.h linux/include/linux/isdnif.h
@@ -1,4 +1,8 @@
-/* $Id: isdnif.h,v 1.20 1997/05/27 15:18:06 fritz Exp $
+/* X25 changes:
+ Added constants ISDN_PROTO_L2_X25DTE/DCE and corresponding ISDN_FEATURE_..
+ */
+
+/* $Id: isdnif.h,v 1.23 1998/02/20 17:36:52 fritz Exp $
*
* Linux ISDN subsystem
*
@@ -22,6 +26,22 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log: isdnif.h,v $
+ * Revision 1.23 1998/02/20 17:36:52 fritz
+ * Added L2-protocols for V.110, changed FEATURE-Flag-constants.
+ *
+ * Revision 1.22 1998/01/31 22:14:12 keil
+ * changes for 2.1.82
+ *
+ * Revision 1.21 1997/10/09 21:28:13 fritz
+ * New HL<->LL interface:
+ * New BSENT callback with nr. of bytes included.
+ * Sending without ACK.
+ * New L1 error status (not yet in use).
+ * Cleaned up obsolete structures.
+ * Implemented Cisco-SLARP.
+ * Changed local net-interface data to be dynamically allocated.
+ * Removed old 2.0 compatibility stuff.
+ *
* Revision 1.20 1997/05/27 15:18:06 fritz
* Added changes for recent 2.1.x kernels:
* changed return type of isdn_close
@@ -104,20 +124,28 @@
#define ISDN_PTYPE_EURO 2 /* EDSS1-protocol */
#define ISDN_PTYPE_LEASED 3 /* for leased lines */
#define ISDN_PTYPE_NI1 4 /* US NI-1 protocol */
+#define ISDN_PTYPE_MAX 7 /* Max. 8 Protocols */
/*
* Values for Layer-2-protocol-selection
*/
-#define ISDN_PROTO_L2_X75I 0 /* X75/LAPB with I-Frames */
-#define ISDN_PROTO_L2_X75UI 1 /* X75/LAPB with UI-Frames */
-#define ISDN_PROTO_L2_X75BUI 2 /* X75/LAPB with UI-Frames */
-#define ISDN_PROTO_L2_HDLC 3 /* HDLC */
-#define ISDN_PROTO_L2_TRANS 4 /* Transparent (Voice) */
+#define ISDN_PROTO_L2_X75I 0 /* X75/LAPB with I-Frames */
+#define ISDN_PROTO_L2_X75UI 1 /* X75/LAPB with UI-Frames */
+#define ISDN_PROTO_L2_X75BUI 2 /* X75/LAPB with UI-Frames */
+#define ISDN_PROTO_L2_HDLC 3 /* HDLC */
+#define ISDN_PROTO_L2_TRANS 4 /* Transparent (Voice) */
+#define ISDN_PROTO_L2_X25DTE 5 /* X25/LAPB DTE mode */
+#define ISDN_PROTO_L2_X25DCE 6 /* X25/LAPB DCE mode */
+#define ISDN_PROTO_L2_V11096 7 /* V.110 bitrate adaption 9600 Baud */
+#define ISDN_PROTO_L2_V11019 8 /* V.110 bitrate adaption 19200 Baud */
+#define ISDN_PROTO_L2_V11038 9 /* V.110 bitrate adaption 38400 Baud */
+#define ISDN_PROTO_L2_MAX 15 /* Max. 16 Protocols */
/*
* Values for Layer-3-protocol-selection
*/
#define ISDN_PROTO_L3_TRANS 0 /* Transparent */
+#define ISDN_PROTO_L3_MAX 7 /* Max. 8 Protocols */
#ifdef __KERNEL__
@@ -127,7 +155,7 @@
* Commands from linklevel to lowlevel
*
*/
-#define ISDN_CMD_IOCTL 0 /* Perform ioctl */
+#define ISDN_CMD_IOCTL 0 /* Perform ioctl */
#define ISDN_CMD_DIAL 1 /* Dial out */
#define ISDN_CMD_ACCEPTD 2 /* Accept an incoming call on D-Chan. */
#define ISDN_CMD_ACCEPTB 3 /* Request B-Channel connect. */
@@ -166,6 +194,13 @@
#define ISDN_STAT_NODCH 268 /* Signal no D-Channel */
#define ISDN_STAT_ADDCH 269 /* Add more Channels */
#define ISDN_STAT_CAUSE 270 /* Cause-Message */
+#define ISDN_STAT_L1ERR 271 /* Signal Layer-1 Error */
+
+/*
+ * Values for errcode field
+ */
+#define ISDN_STAT_L1ERR_SEND 1
+#define ISDN_STAT_L1ERR_RECV 2
/*
* Values for feature-field of interface-struct.
@@ -176,15 +211,29 @@
#define ISDN_FEATURE_L2_X75BUI (0x0001 << ISDN_PROTO_L2_X75BUI)
#define ISDN_FEATURE_L2_HDLC (0x0001 << ISDN_PROTO_L2_HDLC)
#define ISDN_FEATURE_L2_TRANS (0x0001 << ISDN_PROTO_L2_TRANS)
+#define ISDN_FEATURE_L2_X25DTE (0x0001 << ISDN_PROTO_L2_X25DTE)
+#define ISDN_FEATURE_L2_X25DCE (0x0001 << ISDN_PROTO_L2_X25DCE)
+#define ISDN_FEATURE_L2_V11096 (0x0001 << ISDN_PROTO_L2_V11096)
+#define ISDN_FEATURE_L2_V11019 (0x0001 << ISDN_PROTO_L2_V11019)
+#define ISDN_FEATURE_L2_V11038 (0x0001 << ISDN_PROTO_L2_V11038)
+
+#define ISDN_FEATURE_L2_MASK (0x0FFFF) /* Max. 16 protocols */
+#define ISDN_FEATURE_L2_SHIFT (0)
/* Layer 3 */
-#define ISDN_FEATURE_L3_TRANS (0x0100 << ISDN_PROTO_L3_TRANS)
+#define ISDN_FEATURE_L3_TRANS (0x10000 << ISDN_PROTO_L3_TRANS)
+
+#define ISDN_FEATURE_L3_MASK (0x0FF0000) /* Max. 8 Protocols */
+#define ISDN_FEATURE_L3_SHIFT (16)
/* Signaling */
-#define ISDN_FEATURE_P_UNKNOWN (0x1000 << ISDN_PTYPE_UNKNOWN)
-#define ISDN_FEATURE_P_1TR6 (0x1000 << ISDN_PTYPE_1TR6)
-#define ISDN_FEATURE_P_EURO (0x1000 << ISDN_PTYPE_EURO)
-#define ISDN_FEATURE_P_NI1 (0x1000 << ISDN_PTYPE_NI1)
+#define ISDN_FEATURE_P_UNKNOWN (0x1000000 << ISDN_PTYPE_UNKNOWN)
+#define ISDN_FEATURE_P_1TR6 (0x1000000 << ISDN_PTYPE_1TR6)
+#define ISDN_FEATURE_P_EURO (0x1000000 << ISDN_PTYPE_EURO)
+#define ISDN_FEATURE_P_NI1 (0x1000000 << ISDN_PTYPE_NI1)
+
+#define ISDN_FEATURE_P_MASK (0x0FF000000) /* Max. 8 Protocols */
+#define ISDN_FEATURE_P_SHIFT (24)
typedef struct setup_parm {
char phone[32]; /* Remote Phone-Number */
@@ -204,6 +253,8 @@
int command; /* Command or Status (see above) */
ulong arg; /* Additional Data */
union {
+ ulong errcode; /* Type of error with STAT_L1ERR */
+ int length; /* Amount of bytes sent with STAT_BSENT */
char num[50]; /* Additional Data */
setup_parm setup;
} parm;
@@ -238,19 +289,6 @@
*/
unsigned short hl_hdrlen;
- /* Receive-Callback
- * Parameters:
- * int Driver-ID
- * int local channel-number (0 ...)
- * u_char pointer to received data (in Kernel-Space, volatile)
- * int length of data
- *
- * NOTE: This callback is obsolete, and will be removed when all
- * current LL-drivers support rcvcall_skb. Do NOT use for new
- * drivers.
- */
- void (*rcvcallb)(int, int, u_char*, int);
-
/*
* Receive-Callback using sk_buff's
* Parameters:
@@ -269,6 +307,7 @@
* num = depending on status-type.
*/
int (*statcallb)(isdn_ctrl*);
+
/* Send command
* Parameters:
* isdn_ctrl*
@@ -278,31 +317,16 @@
* num = depending on command.
*/
int (*command)(isdn_ctrl*);
- /* Send Data
- * Parameters:
- * int driverId
- * int local channel-number (0 ...)
- * u_char pointer to data
- * int length of data
- * int Flag: 0 = Call form Kernel-Space (use memcpy,
- * no schedule allowed)
- * 1 = Data is in User-Space (use memcpy_fromfs,
- * may schedule)
- *
- * NOTE: This call is obsolete, and will be removed when all
- * current LL-drivers support writebuf_skb. Do NOT use for new
- * drivers.
- */
- int (*writebuf)(int, int, const u_char*, int, int);
/*
* Send data using sk_buff's
* Parameters:
* int driverId
* int local channel-number (0...)
+ * int Flag: Need ACK for this packet.
* struct sk_buff *skb Data to send
*/
- int (*writebuf_skb) (int, int, struct sk_buff *);
+ int (*writebuf_skb) (int, int, int, struct sk_buff *);
/* Send raw D-Channel-Commands
* Parameters:
@@ -316,6 +340,7 @@
* int local channel-number (0 ...)
*/
int (*writecmd)(const u_char*, int, int, int, int);
+
/* Read raw Status replies
* u_char pointer data (volatile)
* int length of buffer
@@ -327,6 +352,7 @@
* int local channel-number (0 ...)
*/
int (*readstat)(u_char*, int, int, int, int);
+
char id[20];
} isdn_if;
@@ -339,8 +365,7 @@
* supporting sk_buff's should set this to 0.
* command Address of Command-Handler.
* features Bitwise coded Features of this driver. (use ISDN_FEATURE_...)
- * writebuf Address of Send-Command-Handler. OBSOLETE do NOT use anymore.
- * writebuf_skb Address of Skbuff-Send-Handler. (NULL if not supported)
+ * writebuf_skb Address of Skbuff-Send-Handler.
* writecmd " " D-Channel " which accepts raw D-Ch-Commands.
* readstat " " D-Channel " which delivers raw Status-Data.
*
@@ -348,72 +373,16 @@
*
* channels Driver-ID assigned to this driver. (Must be used on all
* subsequent callbacks.
- * rcvcallb Address of handler for received data. OBSOLETE, do NOT use anymore.
- * rcvcallb_skb Address of handler for received Skbuff's. (NULL if not supp.)
+ * rcvcallb_skb Address of handler for received Skbuff's.
* statcallb " " " for status-changes.
*
*/
extern int register_isdn(isdn_if*);
-/* Compatibility Linux-2.0.X <-> Linux-2.1.X */
-
#ifndef LINUX_VERSION_CODE
#include <linux/version.h>
#endif
-#if (LINUX_VERSION_CODE < 0x020100)
-#include <linux/mm.h>
-
-static inline unsigned long copy_from_user(void *to, const void *from, unsigned long n)
-{
- int i;
- if ((i = verify_area(VERIFY_READ, from, n)) != 0)
- return i;
- memcpy_fromfs(to, from, n);
- return 0;
-}
-
-static inline unsigned long copy_to_user(void *to, const void *from, unsigned long n)
-{
- int i;
- if ((i = verify_area(VERIFY_WRITE, to, n)) != 0)
- return i;
- memcpy_tofs(to, from, n);
- return 0;
-}
-
-#define GET_USER(x, addr) ( x = get_user(addr) )
-#define RWTYPE int
-#define LSTYPE int
-#define RWARG int
-#define LSARG off_t
-#else
#include <asm/uaccess.h>
-#define GET_USER get_user
-#define PUT_USER put_user
-#define RWTYPE ssize_t
-#define LSTYPE long long
-#define RWARG size_t
-#define LSARG long long
-#endif
-
-#if (LINUX_VERSION_CODE < 0x02010F)
-#define SET_SKB_FREE(x) ( x->free = 1 )
-#else
-#define SET_SKB_FREE(x)
-#endif
-
-#if (LINUX_VERSION_CODE < 0x02011F)
-#define CLOSETYPE void
-#define CLOSEVAL
-#else
-#define CLOSETYPE int
-#define CLOSEVAL (0)
-#endif
-
-#if (LINUX_VERSION_CODE < 0x020125)
-#define test_and_clear_bit clear_bit
-#define test_and_set_bit set_bit
-#endif
#endif /* __KERNEL__ */
#endif /* isdnif_h */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov