1 /*********************************************************************
5 * Description: Information Access Protocol (IAP)
6 * Status: Experimental.
7 * Author: Dag Brattli <dagb@cs.uit.no>
8 * Created at: Thu Aug 21 00:02:07 1997
9 * Modified at: Sun May 9 10:56:57 1999
10 * Modified by: Dag Brattli <dagb@cs.uit.no>
12 * Copyright (c) 1997, 1999 Dag Brattli <dagb@cs.uit.no>, All Rights Reserved.
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
19 * Neither Dag Brattli nor University of Tromsø admit liability nor
20 * provide warranty for any of this software. This material is
21 * provided "AS-IS" and at no charge.
23 ********************************************************************/
28 #include <linux/types.h>
29 #include <linux/skbuff.h>
31 #include <net/irda/qos.h>
32 #include <net/irda/iriap_event.h>
33 #include <net/irda/irias_object.h>
34 #include <net/irda/irqueue.h>
35 #include <net/irda/timer.h>
44 #define GET_INFO_BASE 0x01
45 #define GET_OBJECTS 0x02
46 #define GET_VALUE 0x03
47 #define GET_VALUE_BY_CLASS 0x04
48 #define GET_OBJECT_INFO 0x05
49 #define GET_ATTRIB_NAMES 0x06
52 #define IAS_CLASS_UNKNOWN 1
53 #define IAS_ATTRIB_UNKNOWN 2
54 #define IAS_DISCONNECT 10
56 typedef void (*CONFIRM_CALLBACK
)(int result
, __u16 obj_id
,
57 struct ias_value
*value
, void *priv
);
60 QUEUE queue
; /* Must be first */
62 int magic
; /* Magic cookie */
63 int mode
; /* Client or server */
74 IRIAP_STATE client_state
;
75 IRIAP_STATE call_state
;
78 IRIAP_STATE server_state
;
79 IRIAP_STATE r_connect_state
;
81 CONFIRM_CALLBACK confirm
;
86 struct timer_list watchdog_timer
;
90 void iriap_cleanup(void);
91 void iriap_getvaluebyclass_request( char *name
, char *attr
,
92 __u32 saddr
, __u32 daddr
,
93 CONFIRM_CALLBACK callback
, void *priv
);
94 void iriap_getvaluebyclass_confirm(struct iriap_cb
*self
, struct sk_buff
*skb
);
96 void iriap_send_ack( struct iriap_cb
*self
);
97 void iriap_call_indication(struct iriap_cb
*self
, struct sk_buff
*skb
);
99 void iriap_register_server(void);
101 void iriap_watchdog_timer_expired( unsigned long data
);
103 static inline void iriap_start_watchdog_timer( struct iriap_cb
*self
,
106 irda_start_timer( &self
->watchdog_timer
, timeout
,
107 (unsigned long) self
, iriap_watchdog_timer_expired
);