patch-2.2.7 linux/include/net/irda/irda_device.h

Next file: linux/include/net/irda/iriap.h
Previous file: linux/include/net/irda/irda.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.6/linux/include/net/irda/irda_device.h linux/include/net/irda/irda_device.h
@@ -6,7 +6,7 @@
  * Status:        Experimental.
  * Author:        Haris Zukanovic <haris@stud.cs.uit.no>
  * Created at:    Tue Apr 14 12:41:42 1998
- * Modified at:   Wed Apr  7 17:17:16 1999
+ * Modified at:   Tue Apr 20 11:06:28 1999
  * Modified by:   Dag Brattli <dagb@cs.uit.no>
  * 
  *     Copyright (c) 1998 Haris Zukanovic, <haris@stud.cs.uit.no>
@@ -36,15 +36,18 @@
 #include <net/irda/irda.h>
 #include <net/irda/qos.h>
 #include <net/irda/irqueue.h>
+#include <net/irda/irlap_frame.h>
 
 /* Some non-standard interface flags (should not conflict with any in if.h) */
-#define IFF_SIR 	0x01 /* Supports SIR speeds */
-#define IFF_MIR 	0x02 /* Supports MIR speeds */
-#define IFF_FIR 	0x04 /* Supports FIR speeds */
-#define IFF_PIO   	0x08 /* Supports PIO transfer of data */
-#define IFF_DMA		0x10 /* Supports DMA transfer of data */
-#define IFF_SHM         0x20 /* Supports shared memory data transfers */
-#define IFF_DONGLE      0x40 /* Interface has a dongle attached */
+#define IFF_SIR 	0x0001 /* Supports SIR speeds */
+#define IFF_MIR 	0x0002 /* Supports MIR speeds */
+#define IFF_FIR 	0x0004 /* Supports FIR speeds */
+#define IFF_VFIR        0x0008 /* Supports VFIR speeds */
+#define IFF_PIO   	0x0010 /* Supports PIO transfer of data */
+#define IFF_DMA		0x0020 /* Supports DMA transfer of data */
+#define IFF_SHM         0x0040 /* Supports shared memory data transfers */
+#define IFF_DONGLE      0x0080 /* Interface has a dongle attached */
+#define IFF_AIR         0x0100 /* Supports A(dvanced)IR standards */
 
 #define IO_XMIT 0x01
 #define IO_RECV 0x02
@@ -65,18 +68,17 @@
 	int dongle_id;        /* Dongle or transceiver currently used */
 };
 
-/* Buffer specific info */
+/* IO buffer specific info (inspired by struct sk_buff) */
 struct iobuff_t {
 	int state;            /* Receiving state (transmit state not used) */
 	int in_frame;         /* True if receiving frame */
 
-	__u8 *data;	      /* the buffer */
-	__u8 *head;	      /* start of data in buffer */
+	__u8 *head;	      /* start of buffer */
+	__u8 *data;	      /* start of data in buffer */
 	__u8 *tail;           /* end of data in buffer */
 
-	int offset;	      /* Usually data + offset = head */
-	int len;	      /* currently used bytes in buffer */
-	int truesize;	      /* total size of the data area */
+	int len;	      /* length of data */
+	int truesize;	      /* total size of buffer */
 	__u16 fcs;
 
 	int flags;            /* Allocation flags (GFP_KERNEL | GFP_DMA ) */
@@ -89,7 +91,7 @@
  * stuff from IrDA port implementations.
  */
 struct irda_device {
-	QUEUE q; /* Must be first */
+	QUEUE q;               /* Must be first */
 
         int  magic;	       /* Our magic bullet */
 	char name[16];         /* Name of device "irda0" */
@@ -109,18 +111,18 @@
 	struct iobuff_t tx_buff;
 	struct iobuff_t rx_buff;
 
-	int xbofs;
-	int media_busy;
 	/* spinlock_t lock; */ /* For serializing operations */
 	
 	/* Media busy stuff */
+	int media_busy;
 	struct timer_list media_busy_timer;
 
-	/* Driver specific implementation */
+	/* Callbacks for driver specific implementation */
         void (*change_speed)(struct irda_device *driver, int baud);
- 	int (*is_receiving)(struct irda_device *);     /* receiving? */
+ 	int  (*is_receiving)(struct irda_device *);    /* receiving? */
 	/* int (*is_tbusy)(struct irda_device *); */   /* transmitting? */
 	void (*wait_until_sent)(struct irda_device *);
+	void (*set_caddr)(struct irda_device *);      /* Set connection addr */
 };
 
 extern hashbin_t *irda_device;
@@ -143,8 +145,28 @@
 
 int irda_device_setup(struct device *dev);
 
-inline unsigned short irda_get_mtt(struct sk_buff *skb);
-
 void setup_dma(int channel, char *buffer, int count, int mode);
 
+/*
+ * Function irda_get_mtt (skb)
+ *
+ *    Utility function for getting the minimum turnaround time out of 
+ *    the skb, where it has been hidden in the cb field.
+ */
+inline static __u16 irda_get_mtt(struct sk_buff *skb)
+{
+	__u16 mtt;
+
+	if (((struct irlap_skb_cb *)(skb->cb))->magic != LAP_MAGIC)
+		mtt = 10000;
+	else
+		mtt = ((struct irlap_skb_cb *)(skb->cb))->mtt;
+
+	ASSERT(mtt <= 10000, return 10000;);
+	
+	return mtt;
+}
+
 #endif
+
+

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)