patch-2.1.16 linux/include/linux/hdlcdrv.h

Next file: linux/include/linux/icmp.h
Previous file: linux/include/linux/fs.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.15/linux/include/linux/hdlcdrv.h linux/include/linux/hdlcdrv.h
@@ -20,6 +20,7 @@
 	int iobase;
 	int irq;
 	int dma;
+	int dma2;
 	int seriobase;
 	int pariobase;
 	int midiiobase;
@@ -49,6 +50,8 @@
 		struct hdlcdrv_channel_state cs;
 		unsigned int calibrate;
 		unsigned char bits;
+		char modename[128];
+		char drivername[32];
 	} data;
 };
 
@@ -57,18 +60,38 @@
 /*
  * ioctl values
  */
-#define HDLCDRVCTL_GETMODEMPAR      0
-#define HDLCDRVCTL_SETMODEMPAR      1
-#define HDLCDRVCTL_GETCHANNELPAR    2
-#define HDLCDRVCTL_SETCHANNELPAR    3
-#define HDLCDRVCTL_GETSTAT          4
-#define HDLCDRVCTL_CALIBRATE        5
+#define HDLCDRVCTL_GETMODEMPAR       0
+#define HDLCDRVCTL_SETMODEMPAR       1
+#define HDLCDRVCTL_MODEMPARMASK      2  /* not handled by hdlcdrv */
+#define HDLCDRVCTL_GETCHANNELPAR    10
+#define HDLCDRVCTL_SETCHANNELPAR    11
+#define HDLCDRVCTL_GETSTAT          20
+#define HDLCDRVCTL_CALIBRATE        21
 
 /*
  * these are mainly for debugging purposes
  */
-#define HDLCDRVCTL_GETSAMPLES       10
-#define HDLCDRVCTL_GETBITS          11
+#define HDLCDRVCTL_GETSAMPLES       30
+#define HDLCDRVCTL_GETBITS          31
+
+/*
+ * not handled by hdlcdrv, but by its depending drivers
+ */
+#define HDLCDRVCTL_GETMODE          40
+#define HDLCDRVCTL_SETMODE          41
+#define HDLCDRVCTL_MODELIST         42
+#define HDLCDRVCTL_DRIVERNAME       43
+
+/*
+ * mask of needed modem parameters, returned by HDLCDRVCTL_MODEMPARMASK
+ */
+#define HDLCDRV_PARMASK_IOBASE      (1<<0)
+#define HDLCDRV_PARMASK_IRQ         (1<<1)
+#define HDLCDRV_PARMASK_DMA         (1<<2)
+#define HDLCDRV_PARMASK_DMA2        (1<<3)
+#define HDLCDRV_PARMASK_SERIOBASE   (1<<4)
+#define HDLCDRV_PARMASK_PARIOBASE   (1<<5)
+#define HDLCDRV_PARMASK_MIDIIOBASE  (1<<6)
 
 /* -------------------------------------------------------------------- */
 
@@ -79,7 +102,7 @@
 #define HDLCDRV_HDLCBUFFER  16 /* should be a power of 2 for speed reasons */
 #define HDLCDRV_BITBUFFER  256 /* should be a power of 2 for speed reasons */
 #undef HDLCDRV_LOOPBACK  /* define for HDLC debugging purposes */
-#undef HDLCDRV_DEBUG
+#define HDLCDRV_DEBUG
 
 /* maximum packet length, excluding CRC */
 #define HDLCDRV_MAXFLEN             400	
@@ -133,13 +156,15 @@
 	/*
 	 * first some informations needed by the hdlcdrv routines
 	 */
-	int bitrate;
+	const char *drvname;
+	const char *drvinfo;
 	/*
 	 * the routines called by the hdlcdrv routines
 	 */
 	int (*open)(struct device *);
 	int (*close)(struct device *);
-	int (*ioctl)(struct device *, struct ifreq *, int);
+	int (*ioctl)(struct device *, struct ifreq *, 
+		     struct hdlcdrv_ioctl *, int);
 };
 
 struct hdlcdrv_state {
@@ -149,7 +174,12 @@
 
 	const struct hdlcdrv_ops *ops;
 
+	struct {
+		int bitrate;
+	} par;
+
 	struct hdlcdrv_pttoutput {
+		int dma2;
 		int seriobase;
 		int pariobase;
 		int midiiobase;
@@ -262,12 +292,12 @@
 
 /* -------------------------------------------------------------------- */
 
-extern void hdlcdrv_putbits(struct hdlcdrv_state *s, unsigned int bits)
+extern inline void hdlcdrv_putbits(struct hdlcdrv_state *s, unsigned int bits)
 {
 	hdlcdrv_hbuf_put(&s->hdlcrx.hbuf, bits);
 }
 
-extern unsigned int hdlcdrv_getbits(struct hdlcdrv_state *s)
+extern inline unsigned int hdlcdrv_getbits(struct hdlcdrv_state *s)
 {
 	unsigned int ret;
 
@@ -285,19 +315,19 @@
 	return ret;
 }
 
-extern void hdlcdrv_channelbit(struct hdlcdrv_state *s, unsigned int bit)
+extern inline void hdlcdrv_channelbit(struct hdlcdrv_state *s, unsigned int bit)
 {
 #ifdef HDLCDRV_DEBUG
 	hdlcdrv_add_bitbuffer(&s->bitbuf_channel, bit);
 #endif /* HDLCDRV_DEBUG */
 }
 
-extern void hdlcdrv_setdcd(struct hdlcdrv_state *s, int dcd)
+extern inline void hdlcdrv_setdcd(struct hdlcdrv_state *s, int dcd)
 {
 	s->hdlcrx.dcd = !!dcd;
 }
 
-extern int hdlcdrv_ptt(struct hdlcdrv_state *s)
+extern inline int hdlcdrv_ptt(struct hdlcdrv_state *s)
 {
 	return s->hdlctx.ptt || (s->hdlctx.calibrate > 0);
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov