1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26#ifndef IRIAP_H
27#define IRIAP_H
28
29#include <linux/types.h>
30#include <linux/skbuff.h>
31
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>
36
37#define IAP_LST 0x80
38#define IAP_ACK 0x40
39
40#define IAS_SERVER 0
41#define IAS_CLIENT 1
42
43
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
50
51#define IAS_SUCCESS 0
52#define IAS_CLASS_UNKNOWN 1
53#define IAS_ATTRIB_UNKNOWN 2
54#define IAS_DISCONNECT 10
55
56typedef void (*CONFIRM_CALLBACK)(int result, __u16 obj_id,
57 struct ias_value *value, void *priv);
58
59struct iriap_cb {
60 irda_queue_t q;
61 magic_t magic;
62
63 int mode;
64
65 __u32 saddr;
66 __u32 daddr;
67 __u8 operation;
68
69 struct sk_buff *request_skb;
70 struct lsap_cb *lsap;
71 __u8 slsap_sel;
72
73
74 IRIAP_STATE client_state;
75 IRIAP_STATE call_state;
76
77
78 IRIAP_STATE server_state;
79 IRIAP_STATE r_connect_state;
80
81 CONFIRM_CALLBACK confirm;
82 void *priv;
83
84 __u8 max_header_size;
85 __u32 max_data_size;
86
87 struct timer_list watchdog_timer;
88};
89
90int iriap_init(void);
91void iriap_cleanup(void);
92
93struct iriap_cb *iriap_open(__u8 slsap_sel, int mode, void *priv,
94 CONFIRM_CALLBACK callback);
95void iriap_close(struct iriap_cb *self);
96
97int iriap_getvaluebyclass_request(struct iriap_cb *self,
98 __u32 saddr, __u32 daddr,
99 char *name, char *attr);
100void iriap_connect_request(struct iriap_cb *self);
101void iriap_send_ack( struct iriap_cb *self);
102void iriap_call_indication(struct iriap_cb *self, struct sk_buff *skb);
103
104void iriap_register_server(void);
105
106#endif
107
108
109