patch-2.2.15 linux/include/net/irda/irlmp.h
Next file: linux/include/net/irda/irlmp_event.h
Previous file: linux/include/net/irda/irlap_frame.h
Back to the patch index
Back to the overall index
- Lines: 190
- Date:
Fri Apr 21 23:18:43 2000
- Orig file:
v2.2.14/include/net/irda/irlmp.h
- Orig date:
Sat Aug 14 02:26:51 1999
diff -u --new-file --recursive --exclude-from ../../exclude v2.2.14/include/net/irda/irlmp.h linux/include/net/irda/irlmp.h
@@ -6,10 +6,11 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Sun Aug 17 20:54:32 1997
- * Modified at: Sun May 9 11:01:34 1999
+ * Modified at: Fri Dec 10 13:23:01 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1998-1999 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
@@ -41,17 +42,14 @@
#define LSAP_MASK 0x7f
#define LSAP_IAS 0x00
#define LSAP_ANY 0xff
+#define LSAP_MAX 0x6f /* 0x70-0x7f are reserved */
+#define LSAP_CONNLESS 0x70 /* Connectionless LSAP, mostly used for Ultra */
#define DEV_ADDR_ANY 0xffffffff
-/* Predefined LSAPs used by the various servers */
-#define TSAP_IRLAN 0x05
-#define LSAP_IRLPT 0x06
-#define TSAP_IROBEX 0x07
-#define TSAP_IRCOMM 0x08
-
#define LMP_HEADER 2 /* Dest LSAP + Source LSAP */
#define LMP_CONTROL_HEADER 4
+#define LMP_PID_HEADER 1 /* Used by Ultra */
#define LMP_MAX_HEADER (LMP_CONTROL_HEADER+LAP_MAX_HEADER)
#define LM_MAX_CONNECTIONS 10
@@ -77,13 +75,13 @@
typedef void (*DISCOVERY_CALLBACK2) (hashbin_t *);
typedef struct {
- QUEUE queue; /* Must be first */
+ queue_t queue; /* Must be first */
__u16 hints; /* Hint bits */
} irlmp_service_t;
typedef struct {
- QUEUE queue; /* Must be first */
+ queue_t queue; /* Must be first */
__u16 hint_mask;
@@ -97,24 +95,23 @@
* Information about each logical LSAP connection
*/
struct lsap_cb {
- QUEUE queue; /* Must be first */
-
- int magic;
-
- int connected;
- int persistent;
-
- struct irda_statistics stats;
+ queue_t queue; /* Must be first */
+ magic_t magic;
- __u8 slsap_sel; /* Source (this) LSAP address */
- __u8 dlsap_sel; /* Destination LSAP address (if connected) */
+ int connected;
+ int persistent;
- struct sk_buff *tmp_skb; /* Store skb here while connecting */
+ __u8 slsap_sel; /* Source (this) LSAP address */
+ __u8 dlsap_sel; /* Destination LSAP address (if connected) */
+#ifdef CONFIG_IRDA_ULTRA
+ __u8 pid; /* Used by connectionless LSAP */
+#endif /* CONFIG_IRDA_ULTRA */
+ struct sk_buff *conn_skb; /* Store skb here while connecting */
struct timer_list watchdog_timer;
IRLMP_STATE lsap_state; /* Connection state */
- struct notify_t notify; /* Indication/Confirm entry points */
+ notify_t notify; /* Indication/Confirm entry points */
struct qos_info qos; /* QoS for this connection */
struct lap_cb *lap; /* Pointer to LAP connection structure */
@@ -124,15 +121,16 @@
* Information about each registred IrLAP layer
*/
struct lap_cb {
- QUEUE queue; /* Must be first */
+ queue_t queue; /* Must be first */
+ magic_t magic;
- int magic;
int reason; /* LAP disconnect reason */
IRLMP_STATE lap_state;
- struct irlap_cb *irlap; /* Instance of IrLAP layer */
+ struct irlap_cb *irlap; /* Instance of IrLAP layer */
hashbin_t *lsaps; /* LSAP associated with this link */
+ int refcount;
__u8 caddr; /* Connection address */
__u32 saddr; /* Source device address */
@@ -157,7 +155,7 @@
* Main structure for IrLMP
*/
struct irlmp_cb {
- int magic;
+ magic_t magic;
__u8 conflict_flag;
@@ -187,7 +185,7 @@
/* Prototype declarations */
int irlmp_init(void);
void irlmp_cleanup(void);
-struct lsap_cb *irlmp_open_lsap( __u8 slsap, struct notify_t *notify);
+struct lsap_cb *irlmp_open_lsap(__u8 slsap, notify_t *notify, __u8 pid);
void irlmp_close_lsap( struct lsap_cb *self);
__u16 irlmp_service_to_hint(int service);
@@ -199,30 +197,36 @@
int irlmp_update_client(__u32 handle, __u16 hint_mask,
DISCOVERY_CALLBACK1, DISCOVERY_CALLBACK2);
-void irlmp_register_link(struct irlap_cb *, __u32 saddr, struct notify_t *);
+void irlmp_register_link(struct irlap_cb *, __u32 saddr, notify_t *);
void irlmp_unregister_link(__u32 saddr);
int irlmp_connect_request(struct lsap_cb *, __u8 dlsap_sel,
__u32 saddr, __u32 daddr,
struct qos_info *, struct sk_buff *);
void irlmp_connect_indication(struct lsap_cb *self, struct sk_buff *skb);
-void irlmp_connect_response(struct lsap_cb *, struct sk_buff *);
+int irlmp_connect_response(struct lsap_cb *, struct sk_buff *);
void irlmp_connect_confirm(struct lsap_cb *, struct sk_buff *);
struct lsap_cb *irlmp_dup(struct lsap_cb *self, void *instance);
void irlmp_disconnect_indication(struct lsap_cb *self, LM_REASON reason,
struct sk_buff *userdata);
-void irlmp_disconnect_request(struct lsap_cb *, struct sk_buff *userdata);
+int irlmp_disconnect_request(struct lsap_cb *, struct sk_buff *userdata);
void irlmp_discovery_confirm(hashbin_t *discovery_log);
void irlmp_discovery_request(int nslots);
void irlmp_do_discovery(int nslots);
discovery_t *irlmp_get_discovery_response(void);
-void irlmp_data_request(struct lsap_cb *, struct sk_buff *);
-inline void irlmp_udata_request(struct lsap_cb *, struct sk_buff *);
-inline void irlmp_data_indication(struct lsap_cb *, struct sk_buff *);
-inline void irlmp_udata_indication(struct lsap_cb *, struct sk_buff *);
+int irlmp_data_request(struct lsap_cb *, struct sk_buff *);
+void irlmp_data_indication(struct lsap_cb *, struct sk_buff *);
+
+int irlmp_udata_request(struct lsap_cb *, struct sk_buff *);
+void irlmp_udata_indication(struct lsap_cb *, struct sk_buff *);
+
+#ifdef CONFIG_IRDA_ULTRA
+int irlmp_connless_data_request(struct lsap_cb *, struct sk_buff *);
+void irlmp_connless_data_indication(struct lsap_cb *, struct sk_buff *);
+#endif /* CONFIG_IRDA_ULTRA */
void irlmp_status_request(void);
void irlmp_status_indication(LINK_STATUS link, LOCK_STATUS lock);
@@ -235,10 +239,20 @@
__u32 irlmp_get_daddr(struct lsap_cb *self);
extern char *lmp_reasons[];
+extern int sysctl_discovery_timeout;
extern int sysctl_discovery_slots;
extern int sysctl_discovery;
extern struct irlmp_cb *irlmp;
static inline hashbin_t *irlmp_get_cachelog(void) { return irlmp->cachelog; }
+
+static inline int irlmp_get_lap_tx_queue_len(struct lsap_cb *self)
+{
+ ASSERT(self != NULL, return 0;);
+ ASSERT(self->lap != NULL, return 0;);
+ ASSERT(self->lap->irlap != NULL, return 0;);
+
+ return IRLAP_GET_TX_QUEUE_LEN(self->lap->irlap);
+}
#endif
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)