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
27
28
29
30
31#ifndef IRCOMM_CORE_H
32#define IRCOMM_CORE_H
33
34#include <net/irda/irda.h>
35#include <net/irda/irqueue.h>
36#include <net/irda/ircomm_event.h>
37
38#define IRCOMM_MAGIC 0x98347298
39#define IRCOMM_HEADER_SIZE 1
40
41struct ircomm_cb;
42
43
44
45
46
47typedef struct {
48 int (*data_request)(struct ircomm_cb *, struct sk_buff *, int clen);
49 int (*connect_request)(struct ircomm_cb *, struct sk_buff *,
50 struct ircomm_info *);
51 int (*connect_response)(struct ircomm_cb *, struct sk_buff *);
52 int (*disconnect_request)(struct ircomm_cb *, struct sk_buff *,
53 struct ircomm_info *);
54} call_t;
55
56struct ircomm_cb {
57 irda_queue_t queue;
58 magic_t magic;
59
60 notify_t notify;
61 call_t issue;
62
63 int state;
64 int line;
65
66 struct tsap_cb *tsap;
67 struct lsap_cb *lsap;
68
69 __u8 dlsap_sel;
70 __u8 slsap_sel;
71
72 __u32 saddr;
73 __u32 daddr;
74
75 int max_header_size;
76 int max_data_size;
77
78 LOCAL_FLOW flow_status;
79 int pkt_count;
80
81 __u8 service_type;
82};
83
84extern hashbin_t *ircomm;
85
86struct ircomm_cb *ircomm_open(notify_t *notify, __u8 service_type, int line);
87int ircomm_close(struct ircomm_cb *self);
88
89int ircomm_data_request(struct ircomm_cb *self, struct sk_buff *skb);
90void ircomm_data_indication(struct ircomm_cb *self, struct sk_buff *skb);
91void ircomm_process_data(struct ircomm_cb *self, struct sk_buff *skb);
92int ircomm_control_request(struct ircomm_cb *self, struct sk_buff *skb);
93int ircomm_connect_request(struct ircomm_cb *self, __u8 dlsap_sel,
94 __u32 saddr, __u32 daddr, struct sk_buff *skb,
95 __u8 service_type);
96void ircomm_connect_indication(struct ircomm_cb *self, struct sk_buff *skb,
97 struct ircomm_info *info);
98void ircomm_connect_confirm(struct ircomm_cb *self, struct sk_buff *skb,
99 struct ircomm_info *info);
100int ircomm_connect_response(struct ircomm_cb *self, struct sk_buff *userdata);
101int ircomm_disconnect_request(struct ircomm_cb *self, struct sk_buff *userdata);
102void ircomm_disconnect_indication(struct ircomm_cb *self, struct sk_buff *skb,
103 struct ircomm_info *info);
104void ircomm_flow_request(struct ircomm_cb *self, LOCAL_FLOW flow);
105
106#define ircomm_is_connected(self) (self->state == IRCOMM_CONN)
107
108#endif
109