summaryrefslogtreecommitdiffstats
path: root/include/net/irda
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/irda')
-rw-r--r--include/net/irda/crc.h15
-rw-r--r--include/net/irda/dongle.h14
-rw-r--r--include/net/irda/ircomm_common.h23
-rw-r--r--include/net/irda/irda.h12
-rw-r--r--include/net/irda/irda_device.h62
-rw-r--r--include/net/irda/iriap.h8
-rw-r--r--include/net/irda/irlan_common.h46
-rw-r--r--include/net/irda/irlan_eth.h5
-rw-r--r--include/net/irda/irlan_provider.h10
-rw-r--r--include/net/irda/irlap.h18
-rw-r--r--include/net/irda/irlmp.h6
-rw-r--r--include/net/irda/irlpt_common.h11
-rw-r--r--include/net/irda/irmod.h2
-rw-r--r--include/net/irda/irport.h15
-rw-r--r--include/net/irda/irqueue.h4
-rw-r--r--include/net/irda/irttp.h14
-rw-r--r--include/net/irda/irtty.h27
-rw-r--r--include/net/irda/irvtd.h13
-rw-r--r--include/net/irda/w83977af_ir.h27
-rw-r--r--include/net/irda/wrapper.h18
20 files changed, 210 insertions, 140 deletions
diff --git a/include/net/irda/crc.h b/include/net/irda/crc.h
index d4ee011e4..61a5a6488 100644
--- a/include/net/irda/crc.h
+++ b/include/net/irda/crc.h
@@ -6,25 +6,28 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Mon Aug 4 20:40:53 1997
- * Modified at: Tue Dec 15 22:18:53 1998
+ * Modified at: Sun May 2 20:25:23 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
********************************************************************/
-#ifndef IR_CRC_H
-#define IR_CRC_H
+#ifndef IRDA_CRC_H
+#define IRDA_CRC_H
#include <linux/types.h>
#define INIT_FCS 0xffff /* Initial FCS value */
#define GOOD_FCS 0xf0b8 /* Good final FCS value */
+extern __u16 const irda_crc16_table[];
+
/* Recompute the FCS with one more character appended. */
-#define IR_FCS(fcs, c) (((fcs) >> 8) ^ irda_crc16_table[((fcs) ^ (c)) & 0xff])
+static inline __u16 irda_fcs(__u16 fcs, __u8 c)
+{
+ return (((fcs) >> 8) ^ irda_crc16_table[((fcs) ^ (c)) & 0xff]);
+}
/* Recompute the FCS with len bytes appended. */
unsigned short crc_calc( __u16 fcs, __u8 const *buf, size_t len);
-extern __u16 const irda_crc16_table[];
-
#endif
diff --git a/include/net/irda/dongle.h b/include/net/irda/dongle.h
index d8983c009..82f129fca 100644
--- a/include/net/irda/dongle.h
+++ b/include/net/irda/dongle.h
@@ -6,10 +6,10 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Wed Oct 21 22:47:12 1998
- * Modified at: Sat Feb 6 07:37:49 1999
+ * Modified at: Sun May 16 13:40:03 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1998 Dag Brattli, All Rights Reserved.
+ * Copyright (c) 1998-1999 Dag Brattli, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -26,7 +26,6 @@
#define DONGLE_H
#include <net/irda/qos.h>
-#include <net/irda/irda_device.h>
/* These are the currently known dongles */
typedef enum {
@@ -35,13 +34,16 @@ typedef enum {
ACTISYS_DONGLE,
ACTISYS_PLUS_DONGLE,
GIRBIL_DONGLE,
-} DONGLE_T;
+ LITELINK_DONGLE,
+} IRDA_DONGLE;
+
+struct irda_device;
struct dongle {
- DONGLE_T type;
+ IRDA_DONGLE type;
void (*open)(struct irda_device *, int type);
void (*close)(struct irda_device *);
- void (*reset)( struct irda_device *, int unused);
+ void (*reset)( struct irda_device *);
void (*change_speed)( struct irda_device *, int baudrate);
void (*qos_init)( struct irda_device *, struct qos_info *);
};
diff --git a/include/net/irda/ircomm_common.h b/include/net/irda/ircomm_common.h
index cd1c41f86..44d1b1774 100644
--- a/include/net/irda/ircomm_common.h
+++ b/include/net/irda/ircomm_common.h
@@ -6,7 +6,7 @@
* Status: Experimental.
* Author: Takahide Higuchi <thiguchi@pluto.dti.ne.jp>
*
- * Copyright (c) 1998, Takahide Higuchi, <thiguchi@pluto.dti.ne.jp>,
+ * Copyright (c) 1998-1999, Takahide Higuchi, <thiguchi@pluto.dti.ne.jp>,
* All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
@@ -77,9 +77,9 @@ typedef enum {
#define IRCOMM_MAGIC 0x434f4d4d
#define COMM_INIT_CTRL_PARAM 3 /* length of initial control parameters */
-#define COMM_HEADER 1 /* length of clen field */
-#define COMM_HEADER_SIZE (LAP_HEADER+LMP_HEADER+TTP_HEADER+COMM_HEADER)
-#define COMM_DEFAULT_DATA_SIZE 64
+#define COMM_HEADER_SIZE 1 /* length of clen field */
+#define COMM_MAX_HEADER_SIZE (TTP_MAX_HEADER+COMM_HEADER_SIZE)
+#define COMM_DEFAULT_SDU_SIZE (64 - COMM_HEADER_SIZE)
#define IRCOMM_MAX_CONNECTION 1 /* Don't change for now */
@@ -167,7 +167,7 @@ typedef enum {
#define LSR_BI 0x01 /* Break interrupt indicator */
-struct ircomm_cb{
+struct ircomm_cb {
int magic;
int state; /* Current state of IrCOMM layer:
* DISCOVERY,COMM_IDLE, COMM_WAITR,
@@ -177,8 +177,9 @@ struct ircomm_cb{
int null_modem_mode; /* switch for null modem emulation */
int ttp_stop;
- int max_txbuff_size;
- __u32 maxsdusize;
+ __u32 tx_max_sdu_size;
+ __u32 rx_max_sdu_size;
+ __u8 max_header_size;
__u32 daddr; /* Device address of the peer device */
__u32 saddr;
@@ -201,8 +202,8 @@ struct ircomm_cb{
see Irlmp.c or somewhere :p)*/
int peer_cap; /* capability of peer device */
- struct wait_queue *discovery_wait;
- struct wait_queue *ias_wait;
+ wait_queue_head_t discovery_wait;
+ wait_queue_head_t ias_wait;
/* statistics */
int tx_packets;
@@ -211,8 +212,6 @@ struct ircomm_cb{
int pending_control_tuples;
int ignored_control_tuples;
-
-
__u8 pi ; /* instruction of control channel*/
__u8 port_type;
@@ -253,8 +252,6 @@ struct ircomm_cb{
int port_name_critical;
};
-
-
void ircomm_connect_request(struct ircomm_cb *self, __u8 servicetype);
void ircomm_connect_response(struct ircomm_cb *self, struct sk_buff *userdata,
__u32 maxsdusize);
diff --git a/include/net/irda/irda.h b/include/net/irda/irda.h
index 35c15fadc..b0e67385b 100644
--- a/include/net/irda/irda.h
+++ b/include/net/irda/irda.h
@@ -6,10 +6,10 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Tue Dec 9 21:13:12 1997
- * Modified at: Wed Apr 21 17:49:00 1999
+ * Modified at: Mon May 10 09:51:13 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1998 Dag Brattli, All Rights Reserved.
+ * Copyright (c) 1998-1999 Dag Brattli, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -109,6 +109,8 @@ struct irda_sock {
__u32 max_sdu_size_rx;
__u32 max_sdu_size_tx;
+ __u32 max_data_size;
+ __u8 max_header_size;
struct qos_info qos_tx;
__u16 mask; /* Hint bits mask */
@@ -122,7 +124,7 @@ struct irda_sock {
int errno;
struct sock *sk;
- struct wait_queue *ias_wait; /* Wait for LM-IAS answer */
+ wait_queue_head_t ias_wait; /* Wait for LM-IAS answer */
LOCAL_FLOW tx_flow;
LOCAL_FLOW rx_flow;
@@ -225,10 +227,10 @@ struct notify_t {
int (*udata_indication)(void *priv, void *sap, struct sk_buff *skb);
void (*connect_confirm)(void *instance, void *sap,
struct qos_info *qos, __u32 max_sdu_size,
- struct sk_buff *skb);
+ __u8 max_header_size, struct sk_buff *skb);
void (*connect_indication)(void *instance, void *sap,
struct qos_info *qos, __u32 max_sdu_size,
- struct sk_buff *skb);
+ __u8 max_header_size, struct sk_buff *skb);
void (*disconnect_indication)(void *instance, void *sap,
LM_REASON reason, struct sk_buff *);
void (*flow_indication)(void *instance, void *sap, LOCAL_FLOW flow);
diff --git a/include/net/irda/irda_device.h b/include/net/irda/irda_device.h
index a3dcf2d6e..5272633f7 100644
--- a/include/net/irda/irda_device.h
+++ b/include/net/irda/irda_device.h
@@ -4,24 +4,29 @@
* Version:
* Description:
* Status: Experimental.
- * Author: Haris Zukanovic <haris@stud.cs.uit.no>
+ * Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Tue Apr 14 12:41:42 1998
- * Modified at: Tue Apr 20 11:06:28 1999
+ * Modified at: Wed May 19 08:44:48 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1998 Haris Zukanovic, <haris@stud.cs.uit.no>
- * Copyright (c) 1998 Dag Brattli, <dagb@cs.uit.no>
+ * Copyright (c) 1999 Dag Brattli, All Rights Reserved.
* Copyright (c) 1998 Thomas Davis, <ratbert@radiks.net>,
- * All Rights Reserved.
- *
+ * Copyright (c) 1998 Haris Zukanovic, <haris@stud.cs.uit.no>
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
- *
- * Neither Haris Zukanovic nor University of Tromsų admit liability nor
- * provide warranty for any of this software. This material is
- * provided "AS-IS" and at no charge.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
*
********************************************************************/
@@ -35,6 +40,7 @@
#include <net/irda/irda.h>
#include <net/irda/qos.h>
+#include <net/irda/dongle.h>
#include <net/irda/irqueue.h>
#include <net/irda/irlap_frame.h>
@@ -52,6 +58,11 @@
#define IO_XMIT 0x01
#define IO_RECV 0x02
+struct dongle_q {
+ QUEUE q;
+ struct dongle *dongle;
+};
+
/* Chip specific info */
struct chipio_t {
int iobase, iobase2; /* IO base */
@@ -111,16 +122,19 @@ struct irda_device {
struct iobuff_t tx_buff;
struct iobuff_t rx_buff;
- /* spinlock_t lock; */ /* For serializing operations */
+ struct dongle *dongle; /* Dongle driver */
+
+ spinlock_t lock; /* For serializing operations */
/* Media busy stuff */
int media_busy;
struct timer_list media_busy_timer;
/* Callbacks for driver specific implementation */
- void (*change_speed)(struct irda_device *driver, int baud);
+ void (*change_speed)(struct irda_device *idev, int baud);
int (*is_receiving)(struct irda_device *); /* receiving? */
- /* int (*is_tbusy)(struct irda_device *); */ /* transmitting? */
+ void (*set_dtr_rts)(struct irda_device *idev, int dtr, int rts);
+ int (*raw_write)(struct irda_device *idev, __u8 *buf, int len);
void (*wait_until_sent)(struct irda_device *);
void (*set_caddr)(struct irda_device *); /* Set connection addr */
};
@@ -142,6 +156,9 @@ inline void irda_device_change_speed(struct irda_device *, int);
inline struct qos_info *irda_device_get_qos(struct irda_device *self);
int irda_device_txqueue_empty(struct irda_device *self);
+void irda_device_init_dongle(struct irda_device *self, int type);
+void irda_device_unregister_dongle(struct dongle *dongle);
+int irda_device_register_dongle(struct dongle *dongle);
int irda_device_setup(struct device *dev);
@@ -153,7 +170,7 @@ void setup_dma(int channel, char *buffer, int count, int mode);
* 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)
+extern inline __u16 irda_get_mtt(struct sk_buff *skb)
{
__u16 mtt;
@@ -167,6 +184,23 @@ inline static __u16 irda_get_mtt(struct sk_buff *skb)
return mtt;
}
+extern inline void irda_device_set_dtr_rts(struct irda_device *self, int dtr,
+ int rts)
+{
+ if (self->set_dtr_rts)
+ self->set_dtr_rts(self, dtr, rts);
+}
+
+extern inline int irda_device_raw_write(struct irda_device *self, __u8 *buf,
+ int len)
+{
+ int ret = -1;
+
+ if (self->raw_write)
+ ret = self->raw_write(self, buf, len);
+ return ret;
+}
+
#endif
diff --git a/include/net/irda/iriap.h b/include/net/irda/iriap.h
index 071ed8561..355751afa 100644
--- a/include/net/irda/iriap.h
+++ b/include/net/irda/iriap.h
@@ -6,10 +6,10 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Thu Aug 21 00:02:07 1997
- * Modified at: Wed Apr 21 16:37:21 1999
+ * Modified at: Sun May 9 10:56:57 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1997 Dag Brattli <dagb@cs.uit.no>, All Rights Reserved.
+ * Copyright (c) 1997, 1999 Dag Brattli <dagb@cs.uit.no>, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -81,6 +81,8 @@ struct iriap_cb {
CONFIRM_CALLBACK confirm;
void *priv;
+ __u8 max_header_size;
+
struct timer_list watchdog_timer;
};
@@ -92,8 +94,6 @@ void iriap_getvaluebyclass_request( char *name, char *attr,
void iriap_getvaluebyclass_confirm(struct iriap_cb *self, struct sk_buff *skb);
void iriap_send_ack( struct iriap_cb *self);
-void iriap_connect_confirm(void *instance, void *sap, struct qos_info *qos,
- __u32 max_sdu_size, struct sk_buff *skb);
void iriap_call_indication(struct iriap_cb *self, struct sk_buff *skb);
void iriap_register_server(void);
diff --git a/include/net/irda/irlan_common.h b/include/net/irda/irlan_common.h
index 35d83096f..fc343e5c0 100644
--- a/include/net/irda/irlan_common.h
+++ b/include/net/irda/irlan_common.h
@@ -6,10 +6,11 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Sun Aug 31 20:14:37 1997
- * Modified at: Thu Apr 22 14:30:37 1999
+ * Modified at: Mon May 31 13:54:20 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1998 Dag Brattli <dagb@cs.uit.no>, All Rights Reserved.
+ * Copyright (c) 1998-1999 Dag Brattli <dagb@cs.uit.no>,
+ * All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -98,7 +99,7 @@
#define IRLAN_SHORT 1
#define IRLAN_ARRAY 2
-#define IRLAN_MAX_HEADER (TTP_HEADER+LMP_HEADER+LAP_HEADER)
+#define IRLAN_MAX_HEADER (TTP_HEADER+LMP_HEADER+LAP_MAX_HEADER)
/*
* IrLAN client
@@ -109,7 +110,10 @@ struct irlan_client_cb {
int open_retries;
struct tsap_cb *tsap_ctrl;
+ __u32 max_sdu_size;
+ __u8 max_header_size;
+ int access_type; /* Access type of provider */
__u8 reconnect_key[255];
__u8 key_len;
@@ -120,6 +124,9 @@ struct irlan_client_cb {
int unicast_open;
int broadcast_open;
+ int tx_busy;
+ struct sk_buff_head txq; /* Transmit control queue */
+
struct timer_list kick_timer;
};
@@ -130,6 +137,8 @@ struct irlan_provider_cb {
int state;
struct tsap_cb *tsap_ctrl;
+ __u32 max_sdu_size;
+ __u8 max_header_size;
/*
* Store some values here which are used by the provider to parse
@@ -140,42 +149,45 @@ struct irlan_provider_cb {
int filter_mode;
int filter_operation;
int filter_entry;
-
+ int access_type; /* Access type */
__u16 send_arb_val;
__u8 mac_address[6]; /* Generated MAC address for peer device */
};
/*
- * IrLAN
+ * IrLAN control block
*/
struct irlan_cb {
QUEUE queue; /* Must be first */
int magic;
char ifname[9];
- struct device dev; /* Ethernet device structure*/
+ struct device dev; /* Ethernet device structure*/
struct enet_statistics stats;
- __u32 saddr; /* Source devcie address */
- __u32 daddr; /* Destination device address */
+ __u32 saddr; /* Source device address */
+ __u32 daddr; /* Destination device address */
int netdev_registered;
int notify_irmanager;
- int media; /* Media type */
- int access_type; /* Currently used access type */
- __u8 version[2]; /* IrLAN version */
+ int media; /* Media type */
+ __u8 version[2]; /* IrLAN version */
struct tsap_cb *tsap_data;
- int use_udata; /* Use Unit Data transfers */
+ int master; /* Master instance? */
+ int use_udata; /* Use Unit Data transfers */
- __u8 stsap_sel_data; /* Source data TSAP selector */
- __u8 dtsap_sel_data; /* Destination data TSAP selector */
- __u8 dtsap_sel_ctrl; /* Destination ctrl TSAP selector */
+ __u8 stsap_sel_data; /* Source data TSAP selector */
+ __u8 dtsap_sel_data; /* Destination data TSAP selector */
+ __u8 dtsap_sel_ctrl; /* Destination ctrl TSAP selector */
- struct irlan_client_cb client; /* Client specific fields */
+ struct irlan_client_cb client; /* Client specific fields */
struct irlan_provider_cb provider; /* Provider specific fields */
+
+ __u32 max_sdu_size;
+ __u8 max_header_size;
struct timer_list watchdog_timer;
};
@@ -192,6 +204,8 @@ void irlan_start_watchdog_timer(struct irlan_cb *self, int timeout);
void irlan_open_data_tsap(struct irlan_cb *self);
+int irlan_run_ctrl_tx_queue(struct irlan_cb *self);
+
void irlan_get_provider_info(struct irlan_cb *self);
void irlan_get_unicast_addr(struct irlan_cb *self);
void irlan_get_media_char(struct irlan_cb *self);
diff --git a/include/net/irda/irlan_eth.h b/include/net/irda/irlan_eth.h
index 6ad33ee48..376df91ff 100644
--- a/include/net/irda/irlan_eth.h
+++ b/include/net/irda/irlan_eth.h
@@ -6,10 +6,10 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Thu Oct 15 08:36:58 1998
- * Modified at: Thu Apr 22 14:09:37 1999
+ * Modified at: Fri May 14 23:29:00 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1998 Dag Brattli, All Rights Reserved.
+ * Copyright (c) 1998-1999 Dag Brattli, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -32,6 +32,7 @@ int irlan_eth_receive(void *instance, void *sap, struct sk_buff *skb);
int irlan_eth_xmit(struct sk_buff *skb, struct device *dev);
void irlan_eth_flow_indication( void *instance, void *sap, LOCAL_FLOW flow);
+void irlan_eth_send_gratuitous_arp(struct device *dev);
void irlan_eth_set_multicast_list( struct device *dev);
struct enet_statistics *irlan_eth_get_stats(struct device *dev);
diff --git a/include/net/irda/irlan_provider.h b/include/net/irda/irlan_provider.h
index aafbf9141..ca51d5b7c 100644
--- a/include/net/irda/irlan_provider.h
+++ b/include/net/irda/irlan_provider.h
@@ -6,10 +6,10 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Sun Aug 31 20:14:37 1997
- * Modified at: Thu Apr 22 14:29:16 1999
+ * Modified at: Sun May 9 12:26:11 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1998 Dag Brattli <dagb@cs.uit.no>, All Rights Reserved.
+ * Copyright (c) 1998-1999 Dag Brattli <dagb@cs.uit.no>, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -36,13 +36,7 @@ void irlan_provider_ctrl_disconnect_indication(void *instance, void *sap,
LM_REASON reason,
struct sk_buff *skb);
-void irlan_provider_ctrl_data_indication(void *instance, void *sap,
- struct sk_buff *skb);
-void irlan_provider_connect_indication(void *instance, void *sap,
- struct qos_info *qos,
- __u32 max_sdu_size,
- struct sk_buff *skb);
void irlan_provider_connect_response(struct irlan_cb *, struct tsap_cb *);
int irlan_parse_open_data_cmd(struct irlan_cb *self, struct sk_buff *skb);
diff --git a/include/net/irda/irlap.h b/include/net/irda/irlap.h
index f3b26110f..c5767397e 100644
--- a/include/net/irda/irlap.h
+++ b/include/net/irda/irlap.h
@@ -6,10 +6,10 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Mon Aug 4 20:40:53 1997
- * Modified at: Fri Apr 23 09:51:15 1999
+ * Modified at: Sun May 9 11:38:18 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1998 Dag Brattli <dagb@cs.uit.no>, All Rights Reserved.
+ * Copyright (c) 1998-1999 Dag Brattli <dagb@cs.uit.no>, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -42,11 +42,11 @@
#define LAP_COMP_HEADER 1 /* IrLAP Compression Header */
#ifdef CONFIG_IRDA_COMPRESSION
-# define LAP_HEADER (LAP_ADDR_HEADER + LAP_CTRL_HEADER + LAP_COMP_HEADER)
+# define LAP_MAX_HEADER (LAP_ADDR_HEADER + LAP_CTRL_HEADER + LAP_COMP_HEADER)
# define IRDA_COMPRESSED 1
# define IRDA_NORMAL 0
#else
-#define LAP_HEADER (LAP_ADDR_HEADER + LAP_CTRL_HEADER)
+#define LAP_MAX_HEADER (LAP_ADDR_HEADER + LAP_CTRL_HEADER)
#endif
#define BROADCAST 0xffffffff /* Broadcast device address */
@@ -138,7 +138,7 @@ struct irlap_cb {
__u8 vs; /* Next frame to be sent */
__u8 vr; /* Next frame to be received */
- int tmp;
+/* int tmp; */
__u8 va; /* Last frame acked */
int window; /* Nr of I-frames allowed to send */
int window_size; /* Current negotiated window size */
@@ -155,8 +155,7 @@ struct irlap_cb {
__u8 s; /* Current slot */
int frame_sent; /* Have we sent reply? */
- int discovery_count;
- hashbin_t *discovery_log;
+ hashbin_t *discovery_log;
discovery_t *discovery_cmd;
struct qos_info qos_tx; /* QoS requested by peer */
@@ -227,4 +226,9 @@ void irlap_init_qos_capabilities(struct irlap_cb *, struct qos_info *);
void irlap_apply_default_connection_parameters(struct irlap_cb *self);
void irlap_apply_connection_parameters(struct irlap_cb *, struct qos_info *);
+extern inline __u8 irlap_get_header_size(struct irlap_cb *self)
+{
+ return 2;
+}
+
#endif
diff --git a/include/net/irda/irlmp.h b/include/net/irda/irlmp.h
index 31785883a..e879c6b94 100644
--- a/include/net/irda/irlmp.h
+++ b/include/net/irda/irlmp.h
@@ -6,10 +6,10 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Sun Aug 17 20:54:32 1997
- * Modified at: Fri Apr 23 09:15:07 1999
+ * Modified at: Sun May 9 11:01:34 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1998 Dag Brattli <dagb@cs.uit.no>, All Rights Reserved.
+ * Copyright (c) 1998-1999 Dag Brattli <dagb@cs.uit.no>, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -52,7 +52,7 @@
#define LMP_HEADER 2 /* Dest LSAP + Source LSAP */
#define LMP_CONTROL_HEADER 4
-#define LMP_MAX_HEADER (LAP_HEADER+LMP_HEADER)
+#define LMP_MAX_HEADER (LMP_CONTROL_HEADER+LAP_MAX_HEADER)
#define LM_MAX_CONNECTIONS 10
diff --git a/include/net/irda/irlpt_common.h b/include/net/irda/irlpt_common.h
index 83a9c307c..25ad8ef01 100644
--- a/include/net/irda/irlpt_common.h
+++ b/include/net/irda/irlpt_common.h
@@ -46,7 +46,7 @@ extern char *irlpt_client_fsm_state[];
extern char *irlpt_server_fsm_state[];
extern char *irlpt_fsm_event[];
-extern struct wait_queue *lpt_wait;
+extern wait_queue_head_t lpt_wait;
extern struct irlpt_cb *irlpt_find_handle(unsigned int minor);
extern void irlpt_flow_control(struct sk_buff *skb);
@@ -158,12 +158,13 @@ struct irlpt_cb {
struct miscdevice ir_dev; /* used to register the misc device. */
int count; /* open count */
- int irlap_data_size; /* max frame size we can send */
+ int max_data_size; /* max frame size we can send */
+ int max_header_size; /* how much header space is needed */
int pkt_count; /* how many packets are queued up */
- struct wait_queue *read_wait; /* wait queues */
- struct wait_queue *write_wait;
- struct wait_queue *ex_wait;
+ wait_queue_head_t read_wait; /* wait queues */
+ wait_queue_head_t write_wait;
+ wait_queue_head_t ex_wait;
/* this is used to remove the printer when it's gone */
struct timer_list lpt_timer;
diff --git a/include/net/irda/irmod.h b/include/net/irda/irmod.h
index 651e87dbc..9612a5572 100644
--- a/include/net/irda/irmod.h
+++ b/include/net/irda/irmod.h
@@ -90,7 +90,7 @@ struct irda_todo {
*/
struct irda_cb {
struct miscdevice dev;
- struct wait_queue *wait_queue;
+ wait_queue_head_t *wait_queue;
int in_use;
diff --git a/include/net/irda/irport.h b/include/net/irda/irport.h
index c4a036a4d..0912e0496 100644
--- a/include/net/irda/irport.h
+++ b/include/net/irda/irport.h
@@ -6,10 +6,10 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Sun Aug 3 13:49:59 1997
- * Modified at: Thu Jan 7 14:17:31 1999
+ * Modified at: Wed May 19 15:31:16 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1997, 1998 Dag Brattli <dagb@cs.uit.no>
+ * Copyright (c) 1997, 1998-1999 Dag Brattli <dagb@cs.uit.no>
* All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
@@ -49,13 +49,14 @@
#define FRAME_MAX_SIZE 2048
-void irport_close( int iobase);
-int irport_open( int iobase);
-int irport_detect(struct irda_device *idev);
+void irport_start(struct irda_device *idev, int iobase);
+void irport_stop(struct irda_device *idev, int iobase);
+int irport_probe(int iobase);
-void irport_change_speed( int iobase, int speed);
+void irport_change_speed(struct irda_device *idev, int speed);
void irport_interrupt(int irq, void *dev_id, struct pt_regs *regs);
-int irport_hard_xmit( struct sk_buff *skb, struct device *dev);
+int irport_hard_xmit(struct sk_buff *skb, struct device *dev);
+void irport_wait_until_sent(struct irda_device *idev);
#endif
diff --git a/include/net/irda/irqueue.h b/include/net/irda/irqueue.h
index 1e208ccf4..523de0db6 100644
--- a/include/net/irda/irqueue.h
+++ b/include/net/irda/irqueue.h
@@ -6,7 +6,7 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Tue Jun 9 13:26:50 1998
- * Modified at: Thu Feb 25 20:34:21 1999
+ * Modified at: Tue May 25 07:54:41 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
* Copyright (C) 1998, Aage Kvalnes <aage@cs.uit.no>
@@ -30,8 +30,6 @@
#include <linux/types.h>
#include <asm/spinlock.h>
-/* #include <net/irda/irda.h> */
-
#ifndef QUEUE_H
#define QUEUE_H
diff --git a/include/net/irda/irttp.h b/include/net/irda/irttp.h
index aec1d57dc..3e6511cea 100644
--- a/include/net/irda/irttp.h
+++ b/include/net/irda/irttp.h
@@ -6,10 +6,10 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Sun Aug 31 20:14:31 1997
- * Modified at: Sat Apr 10 10:19:56 1999
+ * Modified at: Mon May 10 19:14:51 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1998 Dag Brattli <dagb@cs.uit.no>, All Rights Reserved.
+ * Copyright (c) 1998-1999 Dag Brattli <dagb@cs.uit.no>, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -36,7 +36,8 @@
#define TTP_MAX_CONNECTIONS LM_MAX_CONNECTIONS
#define TTP_HEADER 1
-#define TTP_HEADER_WITH_SAR 6
+#define TTP_MAX_HEADER (TTP_HEADER + LMP_MAX_HEADER)
+#define TTP_SAR_HEADER 5
#define TTP_PARAMETERS 0x80
#define TTP_MORE 0x80
@@ -61,8 +62,6 @@ struct tsap_cb {
QUEUE queue; /* For linking it into the hashbin */
int magic; /* Just in case */
- int max_seg_size; /* Max data that fit into an IrLAP frame */
-
__u8 stsap_sel; /* Source TSAP */
__u8 dtsap_sel; /* Destination TSAP */
@@ -88,6 +87,9 @@ struct tsap_cb {
struct irda_statistics stats;
struct timer_list todo_timer;
+ __u32 max_seg_size; /* Max data that fit into an IrLAP frame */
+ __u8 max_header_size;
+
int rx_sdu_busy; /* RxSdu.busy */
__u32 rx_sdu_size; /* Current size of a partially received frame */
__u32 rx_max_sdu_size; /* Max receive user data size */
@@ -120,8 +122,6 @@ int irttp_connect_request(struct tsap_cb *self, __u8 dtsap_sel,
__u32 saddr, __u32 daddr,
struct qos_info *qos, __u32 max_sdu_size,
struct sk_buff *userdata);
-void irttp_connect_confirm(void *instance, void *sap, struct qos_info *qos,
- __u32 max_sdu_size, struct sk_buff *skb);
void irttp_connect_response(struct tsap_cb *self, __u32 max_sdu_size,
struct sk_buff *userdata);
struct tsap_cb *irttp_dup(struct tsap_cb *self, void *instance);
diff --git a/include/net/irda/irtty.h b/include/net/irda/irtty.h
index 920909600..38b5c4d81 100644
--- a/include/net/irda/irtty.h
+++ b/include/net/irda/irtty.h
@@ -6,10 +6,10 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Tue Dec 9 21:13:12 1997
- * Modified at: Sun Feb 7 01:57:33 1999
+ * Modified at: Mon May 10 13:22:23 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1997 Dag Brattli, All Rights Reserved.
+ * Copyright (c) 1997, 1999 Dag Brattli, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -33,8 +33,6 @@
#include <net/irda/irqueue.h>
#include <net/irda/irda_device.h>
-#include <net/irda/dongle.h>
-
#define IRTTY_IOC_MAGIC 'e'
#define IRTTY_IOCTDONGLE _IO(IRTTY_IOC_MAGIC, 1)
#define IRTTY_IOC_MAXNR 1
@@ -43,28 +41,21 @@
#define N_IRDA 11 /* This one should go in </asm/termio.h> */
#endif
-struct dongle_q {
- QUEUE q;
-
- struct dongle *dongle;
-};
-
struct irtty_cb {
QUEUE q; /* Must be first */
-/* char name[16]; */
-
int magic;
struct tty_struct *tty; /* Ptr to TTY structure */
struct irda_device idev;
-
- struct dongle_q *dongle_q; /* Has this tty got a dongle attached? */
};
-int irtty_register_dongle( struct dongle *dongle);
-void irtty_unregister_dongle( struct dongle *dongle);
-
-void irtty_set_dtr_rts(struct tty_struct *tty, int dtr, int rts);
+int irtty_register_dongle(struct dongle *dongle);
+void irtty_unregister_dongle(struct dongle *dongle);
#endif
+
+
+
+
+
diff --git a/include/net/irda/irvtd.h b/include/net/irda/irvtd.h
index 1fc7d6b0f..68340087a 100644
--- a/include/net/irda/irvtd.h
+++ b/include/net/irda/irvtd.h
@@ -53,6 +53,8 @@ struct irvtd_cb {
struct sk_buff_head rxbuff;
struct ircomm_cb *comm; /* ircomm instance */
+ __u32 tx_max_sdu_size;
+ __u32 max_header_size;
/*
* These members are used for compatibility with usual serial device.
* See linux/serial.h
@@ -64,12 +66,13 @@ struct irvtd_cb {
int line;
int count; /* open count */
int blocked_open;
- struct wait_queue *open_wait;
- struct wait_queue *close_wait;
- struct wait_queue *delta_msr_wait;
- struct wait_queue *tx_wait;
+ wait_queue_head_t open_wait;
+ wait_queue_head_t close_wait;
+ wait_queue_head_t delta_msr_wait;
+ wait_queue_head_t tx_wait;
- struct timer_list timer;
+ struct timer_list tx_timer;
+ struct timer_list rx_timer;
long pgrp;
long session;
diff --git a/include/net/irda/w83977af_ir.h b/include/net/irda/w83977af_ir.h
index 3e3200b2d..d86456ada 100644
--- a/include/net/irda/w83977af_ir.h
+++ b/include/net/irda/w83977af_ir.h
@@ -6,10 +6,10 @@
* Status: Experimental.
* Author: Paul VanderSpek
* Created at: Thu Nov 19 13:55:34 1998
- * Modified at: Thu Dec 10 14:06:18 1998
+ * Modified at: Mon May 3 12:07:25 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1998 Dag Brattli, All Rights Reserved.
+ * Copyright (c) 1998-1999 Dag Brattli, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -150,6 +150,29 @@
#define IRM_CR_IRX_MSL 0x40
#define IRM_CR_AF_MNT 0x80 /* Automatic format */
+/* For storing entries in the status FIFO */
+struct st_fifo_entry {
+ int status;
+ int len;
+};
+
+struct st_fifo {
+ struct st_fifo_entry entries[10];
+ int head;
+ int tail;
+ int len;
+};
+
+/* Private data for each instance */
+struct w83977af_ir {
+ struct st_fifo st_fifo;
+
+ int tx_buff_offsets[10]; /* Offsets between frames in tx_buff */
+ int tx_len; /* Number of frames in tx_buff */
+
+ struct irda_device idev;
+};
+
static inline void switch_bank( int iobase, int set)
{
outb( set, iobase+SSR);
diff --git a/include/net/irda/wrapper.h b/include/net/irda/wrapper.h
index ca21ebec5..fa7ceb25c 100644
--- a/include/net/irda/wrapper.h
+++ b/include/net/irda/wrapper.h
@@ -1,15 +1,16 @@
/*********************************************************************
*
* Filename: wrapper.h
- * Version: 1.0
- * Description: IrDA Wrapper layer
+ * Version: 1.2
+ * Description: IrDA SIR async wrapper layer
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Mon Aug 4 20:40:53 1997
- * Modified at: Fri Jan 29 10:15:46 1999
+ * Modified at: Mon May 3 09:02:36 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1998 Dag Brattli <dagb@cs.uit.no>, All Rights Reserved.
+ * Copyright (c) 1998-1999 Dag Brattli <dagb@cs.uit.no>,
+ * All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -38,17 +39,18 @@
#define STA BOF /* Start flag */
#define STO EOF /* End flag */
-#define IR_TRANS 0x20 /* Asynchronous transparency modifier */
+#define IRDA_TRANS 0x20 /* Asynchronous transparency modifier */
+/* States for receving a frame in async mode */
enum {
- OUTSIDE_FRAME = 1,
+ OUTSIDE_FRAME,
BEGIN_FRAME,
LINK_ESCAPE,
INSIDE_FRAME
};
/* Proto definitions */
-int async_wrap_skb( struct sk_buff *skb, __u8 *tx_buff, int buffsize);
-void async_unwrap_char( struct irda_device *, __u8 byte);
+int async_wrap_skb(struct sk_buff *skb, __u8 *tx_buff, int buffsize);
+inline void async_unwrap_char(struct irda_device *idev, __u8 byte);
#endif