6b13f685e
김민수
BSP 최초 추가
|
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
|
#ifndef IRTTP_H
#define IRTTP_H
#include <linux/types.h>
#include <linux/skbuff.h>
#include <linux/spinlock.h>
#include <net/irda/irda.h>
#include <net/irda/irlmp.h> /* struct lsap_cb */
#include <net/irda/qos.h> /* struct qos_info */
#include <net/irda/irqueue.h>
#define TTP_MAX_CONNECTIONS LM_MAX_CONNECTIONS
#define TTP_HEADER 1
#define TTP_MAX_HEADER (TTP_HEADER + LMP_MAX_HEADER)
#define TTP_SAR_HEADER 5
#define TTP_PARAMETERS 0x80
#define TTP_MORE 0x80
#define TTP_TX_MAX_QUEUE 14
#define TTP_TX_LOW_THRESHOLD 5
#define TTP_TX_HIGH_THRESHOLD 7
#define TTP_RX_MIN_CREDIT 8
#define TTP_RX_DEFAULT_CREDIT 16
#define TTP_RX_MAX_CREDIT 21
#define DEFAULT_INITIAL_CREDIT TTP_RX_DEFAULT_CREDIT
#define P_NORMAL 0
#define P_HIGH 1
#define TTP_SAR_DISABLE 0
#define TTP_SAR_UNBOUND 0xffffffff
#define TTP_MAX_SDU_SIZE 0x01
struct tsap_cb {
irda_queue_t q;
magic_t magic;
__u8 stsap_sel;
__u8 dtsap_sel;
struct lsap_cb *lsap;
__u8 connected;
__u8 initial_credit;
int avail_credit;
int remote_credit;
int send_credit;
struct sk_buff_head tx_queue;
struct sk_buff_head rx_queue;
struct sk_buff_head rx_fragments;
int tx_queue_lock;
int rx_queue_lock;
spinlock_t lock;
notify_t notify;
struct net_device_stats stats;
struct timer_list todo_timer;
__u32 max_seg_size;
__u8 max_header_size;
int rx_sdu_busy;
__u32 rx_sdu_size;
__u32 rx_max_sdu_size;
int tx_sdu_busy;
__u32 tx_max_sdu_size;
int close_pend;
unsigned long disconnect_pend;
struct sk_buff *disconnect_skb;
};
struct irttp_cb {
magic_t magic;
hashbin_t *tsaps;
};
int irttp_init(void);
void irttp_cleanup(void);
struct tsap_cb *irttp_open_tsap(__u8 stsap_sel, int credit, notify_t *notify);
int irttp_close_tsap(struct tsap_cb *self);
int irttp_data_request(struct tsap_cb *self, struct sk_buff *skb);
int irttp_udata_request(struct tsap_cb *self, struct sk_buff *skb);
int irttp_connect_request(struct tsap_cb *self, __u8 dtsap_sel,
__u32 saddr, __u32 daddr,
struct qos_info *qos, __u32 max_sdu_size,
struct sk_buff *userdata);
int irttp_connect_response(struct tsap_cb *self, __u32 max_sdu_size,
struct sk_buff *userdata);
int irttp_disconnect_request(struct tsap_cb *self, struct sk_buff *skb,
int priority);
void irttp_flow_request(struct tsap_cb *self, LOCAL_FLOW flow);
struct tsap_cb *irttp_dup(struct tsap_cb *self, void *instance);
static inline __u32 irttp_get_saddr(struct tsap_cb *self)
{
return irlmp_get_saddr(self->lsap);
}
static inline __u32 irttp_get_daddr(struct tsap_cb *self)
{
return irlmp_get_daddr(self->lsap);
}
static inline __u32 irttp_get_max_seg_size(struct tsap_cb *self)
{
return self->max_seg_size;
}
static inline void irttp_listen(struct tsap_cb *self)
{
irlmp_listen(self->lsap);
self->dtsap_sel = LSAP_ANY;
}
static inline int irttp_is_primary(struct tsap_cb *self)
{
if ((self == NULL) ||
(self->lsap == NULL) ||
(self->lsap->lap == NULL) ||
(self->lsap->lap->irlap == NULL))
return -2;
return irlap_is_primary(self->lsap->lap->irlap);
}
#endif /* IRTTP_H */
|