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 IRLAP_FRAME_H
32#define IRLAP_FRAME_H
33
34#include <linux/skbuff.h>
35
36#include <net/irda/irda.h>
37
38
39struct irlap_cb;
40struct discovery_t;
41
42
43#define INVALID 0xff
44
45
46#define SNRM_CMD 0x83
47#define DISC_CMD 0x43
48#define XID_CMD 0x2f
49#define TEST_CMD 0xe3
50
51
52#define RNRM_RSP 0x83
53#define UA_RSP 0x63
54#define FRMR_RSP 0x87
55#define DM_RSP 0x0f
56#define RD_RSP 0x43
57#define XID_RSP 0xaf
58#define TEST_RSP 0xe3
59
60
61#define RR 0x01
62#define REJ 0x09
63#define RNR 0x05
64#define SREJ 0x0d
65
66
67#define I_FRAME 0x00
68#define UI_FRAME 0x03
69
70#define CMD_FRAME 0x01
71#define RSP_FRAME 0x00
72
73#define PF_BIT 0x10
74
75
76
77
78
79
80#define IRLAP_NEGOCIATION_PARAMS_LEN 25
81#define IRLAP_DISCOVERY_INFO_LEN 32
82
83struct disc_frame {
84 __u8 caddr;
85 __u8 control;
86} __packed;
87
88struct xid_frame {
89 __u8 caddr;
90 __u8 control;
91 __u8 ident;
92 __le32 saddr;
93 __le32 daddr;
94 __u8 flags;
95 __u8 slotnr;
96 __u8 version;
97} __packed;
98
99struct test_frame {
100 __u8 caddr;
101 __u8 control;
102 __le32 saddr;
103 __le32 daddr;
104} __packed;
105
106struct ua_frame {
107 __u8 caddr;
108 __u8 control;
109 __le32 saddr;
110 __le32 daddr;
111} __packed;
112
113struct dm_frame {
114 __u8 caddr;
115 __u8 control;
116} __packed;
117
118struct rd_frame {
119 __u8 caddr;
120 __u8 control;
121} __packed;
122
123struct rr_frame {
124 __u8 caddr;
125 __u8 control;
126} __packed;
127
128struct i_frame {
129 __u8 caddr;
130 __u8 control;
131} __packed;
132
133struct snrm_frame {
134 __u8 caddr;
135 __u8 control;
136 __le32 saddr;
137 __le32 daddr;
138 __u8 ncaddr;
139} __packed;
140
141void irlap_queue_xmit(struct irlap_cb *self, struct sk_buff *skb);
142void irlap_send_discovery_xid_frame(struct irlap_cb *, int S, __u8 s,
143 __u8 command,
144 struct discovery_t *discovery);
145void irlap_send_snrm_frame(struct irlap_cb *, struct qos_info *);
146void irlap_send_test_frame(struct irlap_cb *self, __u8 caddr, __u32 daddr,
147 struct sk_buff *cmd);
148void irlap_send_ua_response_frame(struct irlap_cb *, struct qos_info *);
149void irlap_send_dm_frame(struct irlap_cb *self);
150void irlap_send_rd_frame(struct irlap_cb *self);
151void irlap_send_disc_frame(struct irlap_cb *self);
152void irlap_send_rr_frame(struct irlap_cb *self, int command);
153
154void irlap_send_data_primary(struct irlap_cb *, struct sk_buff *);
155void irlap_send_data_primary_poll(struct irlap_cb *, struct sk_buff *);
156void irlap_send_data_secondary(struct irlap_cb *, struct sk_buff *);
157void irlap_send_data_secondary_final(struct irlap_cb *, struct sk_buff *);
158void irlap_resend_rejected_frames(struct irlap_cb *, int command);
159void irlap_resend_rejected_frame(struct irlap_cb *self, int command);
160
161void irlap_send_ui_frame(struct irlap_cb *self, struct sk_buff *skb,
162 __u8 caddr, int command);
163
164int irlap_insert_qos_negotiation_params(struct irlap_cb *self,
165 struct sk_buff *skb);
166
167#endif
168