diff options
Diffstat (limited to 'net/irda/irlan/irlan_client_event.c')
-rw-r--r-- | net/irda/irlan/irlan_client_event.c | 190 |
1 files changed, 95 insertions, 95 deletions
diff --git a/net/irda/irlan/irlan_client_event.c b/net/irda/irlan/irlan_client_event.c index ce943b69e996..843ab6fbb394 100644 --- a/net/irda/irlan/irlan_client_event.c +++ b/net/irda/irlan/irlan_client_event.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /********************************************************************* | 1 | /********************************************************************* |
2 | * | 2 | * |
3 | * Filename: irlan_client_event.c | 3 | * Filename: irlan_client_event.c |
4 | * Version: 0.9 | 4 | * Version: 0.9 |
5 | * Description: IrLAN client state machine | 5 | * Description: IrLAN client state machine |
@@ -8,17 +8,17 @@ | |||
8 | * Created at: Sun Aug 31 20:14:37 1997 | 8 | * Created at: Sun Aug 31 20:14:37 1997 |
9 | * Modified at: Sun Dec 26 21:52:24 1999 | 9 | * Modified at: Sun Dec 26 21:52:24 1999 |
10 | * Modified by: Dag Brattli <dagb@cs.uit.no> | 10 | * Modified by: Dag Brattli <dagb@cs.uit.no> |
11 | * | 11 | * |
12 | * Copyright (c) 1998-1999 Dag Brattli <dagb@cs.uit.no>, | 12 | * Copyright (c) 1998-1999 Dag Brattli <dagb@cs.uit.no>, |
13 | * All Rights Reserved. | 13 | * All Rights Reserved. |
14 | * | 14 | * |
15 | * This program is free software; you can redistribute it and/or | 15 | * This program is free software; you can redistribute it and/or |
16 | * modify it under the terms of the GNU General Public License as | 16 | * modify it under the terms of the GNU General Public License as |
17 | * published by the Free Software Foundation; either version 2 of | 17 | * published by the Free Software Foundation; either version 2 of |
18 | * the License, or (at your option) any later version. | 18 | * the License, or (at your option) any later version. |
19 | * | 19 | * |
20 | * Neither Dag Brattli nor University of Tromsų admit liability nor | 20 | * Neither Dag Brattli nor University of Tromsų admit liability nor |
21 | * provide warranty for any of this software. This material is | 21 | * provide warranty for any of this software. This material is |
22 | * provided "AS-IS" and at no charge. | 22 | * provided "AS-IS" and at no charge. |
23 | * | 23 | * |
24 | ********************************************************************/ | 24 | ********************************************************************/ |
@@ -36,31 +36,31 @@ | |||
36 | #include <net/irda/irlan_client.h> | 36 | #include <net/irda/irlan_client.h> |
37 | #include <net/irda/irlan_event.h> | 37 | #include <net/irda/irlan_event.h> |
38 | 38 | ||
39 | static int irlan_client_state_idle (struct irlan_cb *self, IRLAN_EVENT event, | 39 | static int irlan_client_state_idle (struct irlan_cb *self, IRLAN_EVENT event, |
40 | struct sk_buff *skb); | 40 | struct sk_buff *skb); |
41 | static int irlan_client_state_query(struct irlan_cb *self, IRLAN_EVENT event, | 41 | static int irlan_client_state_query(struct irlan_cb *self, IRLAN_EVENT event, |
42 | struct sk_buff *skb); | 42 | struct sk_buff *skb); |
43 | static int irlan_client_state_conn (struct irlan_cb *self, IRLAN_EVENT event, | 43 | static int irlan_client_state_conn (struct irlan_cb *self, IRLAN_EVENT event, |
44 | struct sk_buff *skb); | 44 | struct sk_buff *skb); |
45 | static int irlan_client_state_info (struct irlan_cb *self, IRLAN_EVENT event, | 45 | static int irlan_client_state_info (struct irlan_cb *self, IRLAN_EVENT event, |
46 | struct sk_buff *skb); | 46 | struct sk_buff *skb); |
47 | static int irlan_client_state_media(struct irlan_cb *self, IRLAN_EVENT event, | 47 | static int irlan_client_state_media(struct irlan_cb *self, IRLAN_EVENT event, |
48 | struct sk_buff *skb); | 48 | struct sk_buff *skb); |
49 | static int irlan_client_state_open (struct irlan_cb *self, IRLAN_EVENT event, | 49 | static int irlan_client_state_open (struct irlan_cb *self, IRLAN_EVENT event, |
50 | struct sk_buff *skb); | 50 | struct sk_buff *skb); |
51 | static int irlan_client_state_wait (struct irlan_cb *self, IRLAN_EVENT event, | 51 | static int irlan_client_state_wait (struct irlan_cb *self, IRLAN_EVENT event, |
52 | struct sk_buff *skb); | 52 | struct sk_buff *skb); |
53 | static int irlan_client_state_arb (struct irlan_cb *self, IRLAN_EVENT event, | 53 | static int irlan_client_state_arb (struct irlan_cb *self, IRLAN_EVENT event, |
54 | struct sk_buff *skb); | 54 | struct sk_buff *skb); |
55 | static int irlan_client_state_data (struct irlan_cb *self, IRLAN_EVENT event, | 55 | static int irlan_client_state_data (struct irlan_cb *self, IRLAN_EVENT event, |
56 | struct sk_buff *skb); | 56 | struct sk_buff *skb); |
57 | static int irlan_client_state_close(struct irlan_cb *self, IRLAN_EVENT event, | 57 | static int irlan_client_state_close(struct irlan_cb *self, IRLAN_EVENT event, |
58 | struct sk_buff *skb); | 58 | struct sk_buff *skb); |
59 | static int irlan_client_state_sync (struct irlan_cb *self, IRLAN_EVENT event, | 59 | static int irlan_client_state_sync (struct irlan_cb *self, IRLAN_EVENT event, |
60 | struct sk_buff *skb); | 60 | struct sk_buff *skb); |
61 | 61 | ||
62 | static int (*state[])(struct irlan_cb *, IRLAN_EVENT event, struct sk_buff *) = | 62 | static int (*state[])(struct irlan_cb *, IRLAN_EVENT event, struct sk_buff *) = |
63 | { | 63 | { |
64 | irlan_client_state_idle, | 64 | irlan_client_state_idle, |
65 | irlan_client_state_query, | 65 | irlan_client_state_query, |
66 | irlan_client_state_conn, | 66 | irlan_client_state_conn, |
@@ -74,8 +74,8 @@ static int (*state[])(struct irlan_cb *, IRLAN_EVENT event, struct sk_buff *) = | |||
74 | irlan_client_state_sync | 74 | irlan_client_state_sync |
75 | }; | 75 | }; |
76 | 76 | ||
77 | void irlan_do_client_event(struct irlan_cb *self, IRLAN_EVENT event, | 77 | void irlan_do_client_event(struct irlan_cb *self, IRLAN_EVENT event, |
78 | struct sk_buff *skb) | 78 | struct sk_buff *skb) |
79 | { | 79 | { |
80 | IRDA_ASSERT(self != NULL, return;); | 80 | IRDA_ASSERT(self != NULL, return;); |
81 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); | 81 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); |
@@ -89,14 +89,14 @@ void irlan_do_client_event(struct irlan_cb *self, IRLAN_EVENT event, | |||
89 | * IDLE, We are waiting for an indication that there is a provider | 89 | * IDLE, We are waiting for an indication that there is a provider |
90 | * available. | 90 | * available. |
91 | */ | 91 | */ |
92 | static int irlan_client_state_idle(struct irlan_cb *self, IRLAN_EVENT event, | 92 | static int irlan_client_state_idle(struct irlan_cb *self, IRLAN_EVENT event, |
93 | struct sk_buff *skb) | 93 | struct sk_buff *skb) |
94 | { | 94 | { |
95 | IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); | 95 | IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); |
96 | 96 | ||
97 | IRDA_ASSERT(self != NULL, return -1;); | 97 | IRDA_ASSERT(self != NULL, return -1;); |
98 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return -1;); | 98 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return -1;); |
99 | 99 | ||
100 | switch (event) { | 100 | switch (event) { |
101 | case IRLAN_DISCOVERY_INDICATION: | 101 | case IRLAN_DISCOVERY_INDICATION: |
102 | if (self->client.iriap) { | 102 | if (self->client.iriap) { |
@@ -104,7 +104,7 @@ static int irlan_client_state_idle(struct irlan_cb *self, IRLAN_EVENT event, | |||
104 | __FUNCTION__); | 104 | __FUNCTION__); |
105 | return -EBUSY; | 105 | return -EBUSY; |
106 | } | 106 | } |
107 | 107 | ||
108 | self->client.iriap = iriap_open(LSAP_ANY, IAS_CLIENT, self, | 108 | self->client.iriap = iriap_open(LSAP_ANY, IAS_CLIENT, self, |
109 | irlan_client_get_value_confirm); | 109 | irlan_client_get_value_confirm); |
110 | /* Get some values from peer IAS */ | 110 | /* Get some values from peer IAS */ |
@@ -120,7 +120,7 @@ static int irlan_client_state_idle(struct irlan_cb *self, IRLAN_EVENT event, | |||
120 | IRDA_DEBUG(4, "%s(), Unknown event %d\n", __FUNCTION__ , event); | 120 | IRDA_DEBUG(4, "%s(), Unknown event %d\n", __FUNCTION__ , event); |
121 | break; | 121 | break; |
122 | } | 122 | } |
123 | if (skb) | 123 | if (skb) |
124 | dev_kfree_skb(skb); | 124 | dev_kfree_skb(skb); |
125 | 125 | ||
126 | return 0; | 126 | return 0; |
@@ -133,23 +133,23 @@ static int irlan_client_state_idle(struct irlan_cb *self, IRLAN_EVENT event, | |||
133 | * to provider, just waiting for the confirm. | 133 | * to provider, just waiting for the confirm. |
134 | * | 134 | * |
135 | */ | 135 | */ |
136 | static int irlan_client_state_query(struct irlan_cb *self, IRLAN_EVENT event, | 136 | static int irlan_client_state_query(struct irlan_cb *self, IRLAN_EVENT event, |
137 | struct sk_buff *skb) | 137 | struct sk_buff *skb) |
138 | { | 138 | { |
139 | IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); | 139 | IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); |
140 | 140 | ||
141 | IRDA_ASSERT(self != NULL, return -1;); | 141 | IRDA_ASSERT(self != NULL, return -1;); |
142 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return -1;); | 142 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return -1;); |
143 | 143 | ||
144 | switch(event) { | 144 | switch(event) { |
145 | case IRLAN_IAS_PROVIDER_AVAIL: | 145 | case IRLAN_IAS_PROVIDER_AVAIL: |
146 | IRDA_ASSERT(self->dtsap_sel_ctrl != 0, return -1;); | 146 | IRDA_ASSERT(self->dtsap_sel_ctrl != 0, return -1;); |
147 | 147 | ||
148 | self->client.open_retries = 0; | 148 | self->client.open_retries = 0; |
149 | 149 | ||
150 | irttp_connect_request(self->client.tsap_ctrl, | 150 | irttp_connect_request(self->client.tsap_ctrl, |
151 | self->dtsap_sel_ctrl, | 151 | self->dtsap_sel_ctrl, |
152 | self->saddr, self->daddr, NULL, | 152 | self->saddr, self->daddr, NULL, |
153 | IRLAN_MTU, NULL); | 153 | IRLAN_MTU, NULL); |
154 | irlan_next_client_state(self, IRLAN_CONN); | 154 | irlan_next_client_state(self, IRLAN_CONN); |
155 | break; | 155 | break; |
@@ -158,7 +158,7 @@ static int irlan_client_state_query(struct irlan_cb *self, IRLAN_EVENT event, | |||
158 | irlan_next_client_state(self, IRLAN_IDLE); | 158 | irlan_next_client_state(self, IRLAN_IDLE); |
159 | 159 | ||
160 | /* Give the client a kick! */ | 160 | /* Give the client a kick! */ |
161 | if ((self->provider.access_type == ACCESS_PEER) && | 161 | if ((self->provider.access_type == ACCESS_PEER) && |
162 | (self->provider.state != IRLAN_IDLE)) | 162 | (self->provider.state != IRLAN_IDLE)) |
163 | irlan_client_wakeup(self, self->saddr, self->daddr); | 163 | irlan_client_wakeup(self, self->saddr, self->daddr); |
164 | break; | 164 | break; |
@@ -175,7 +175,7 @@ static int irlan_client_state_query(struct irlan_cb *self, IRLAN_EVENT event, | |||
175 | } | 175 | } |
176 | if (skb) | 176 | if (skb) |
177 | dev_kfree_skb(skb); | 177 | dev_kfree_skb(skb); |
178 | 178 | ||
179 | return 0; | 179 | return 0; |
180 | } | 180 | } |
181 | 181 | ||
@@ -186,13 +186,13 @@ static int irlan_client_state_query(struct irlan_cb *self, IRLAN_EVENT event, | |||
186 | * commands yet. | 186 | * commands yet. |
187 | * | 187 | * |
188 | */ | 188 | */ |
189 | static int irlan_client_state_conn(struct irlan_cb *self, IRLAN_EVENT event, | 189 | static int irlan_client_state_conn(struct irlan_cb *self, IRLAN_EVENT event, |
190 | struct sk_buff *skb) | 190 | struct sk_buff *skb) |
191 | { | 191 | { |
192 | IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); | 192 | IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); |
193 | 193 | ||
194 | IRDA_ASSERT(self != NULL, return -1;); | 194 | IRDA_ASSERT(self != NULL, return -1;); |
195 | 195 | ||
196 | switch (event) { | 196 | switch (event) { |
197 | case IRLAN_CONNECT_COMPLETE: | 197 | case IRLAN_CONNECT_COMPLETE: |
198 | /* Send getinfo cmd */ | 198 | /* Send getinfo cmd */ |
@@ -212,7 +212,7 @@ static int irlan_client_state_conn(struct irlan_cb *self, IRLAN_EVENT event, | |||
212 | } | 212 | } |
213 | if (skb) | 213 | if (skb) |
214 | dev_kfree_skb(skb); | 214 | dev_kfree_skb(skb); |
215 | 215 | ||
216 | return 0; | 216 | return 0; |
217 | } | 217 | } |
218 | 218 | ||
@@ -221,24 +221,24 @@ static int irlan_client_state_conn(struct irlan_cb *self, IRLAN_EVENT event, | |||
221 | * | 221 | * |
222 | * INFO, We have issued a GetInfo command and is awaiting a reply. | 222 | * INFO, We have issued a GetInfo command and is awaiting a reply. |
223 | */ | 223 | */ |
224 | static int irlan_client_state_info(struct irlan_cb *self, IRLAN_EVENT event, | 224 | static int irlan_client_state_info(struct irlan_cb *self, IRLAN_EVENT event, |
225 | struct sk_buff *skb) | 225 | struct sk_buff *skb) |
226 | { | 226 | { |
227 | IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); | 227 | IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); |
228 | 228 | ||
229 | IRDA_ASSERT(self != NULL, return -1;); | 229 | IRDA_ASSERT(self != NULL, return -1;); |
230 | 230 | ||
231 | switch (event) { | 231 | switch (event) { |
232 | case IRLAN_DATA_INDICATION: | 232 | case IRLAN_DATA_INDICATION: |
233 | IRDA_ASSERT(skb != NULL, return -1;); | 233 | IRDA_ASSERT(skb != NULL, return -1;); |
234 | 234 | ||
235 | irlan_client_parse_response(self, skb); | 235 | irlan_client_parse_response(self, skb); |
236 | 236 | ||
237 | irlan_next_client_state(self, IRLAN_MEDIA); | 237 | irlan_next_client_state(self, IRLAN_MEDIA); |
238 | 238 | ||
239 | irlan_get_media_char(self); | 239 | irlan_get_media_char(self); |
240 | break; | 240 | break; |
241 | 241 | ||
242 | case IRLAN_LMP_DISCONNECT: | 242 | case IRLAN_LMP_DISCONNECT: |
243 | case IRLAN_LAP_DISCONNECT: | 243 | case IRLAN_LAP_DISCONNECT: |
244 | irlan_next_client_state(self, IRLAN_IDLE); | 244 | irlan_next_client_state(self, IRLAN_IDLE); |
@@ -252,7 +252,7 @@ static int irlan_client_state_info(struct irlan_cb *self, IRLAN_EVENT event, | |||
252 | } | 252 | } |
253 | if (skb) | 253 | if (skb) |
254 | dev_kfree_skb(skb); | 254 | dev_kfree_skb(skb); |
255 | 255 | ||
256 | return 0; | 256 | return 0; |
257 | } | 257 | } |
258 | 258 | ||
@@ -263,11 +263,11 @@ static int irlan_client_state_info(struct irlan_cb *self, IRLAN_EVENT event, | |||
263 | * reply. | 263 | * reply. |
264 | * | 264 | * |
265 | */ | 265 | */ |
266 | static int irlan_client_state_media(struct irlan_cb *self, IRLAN_EVENT event, | 266 | static int irlan_client_state_media(struct irlan_cb *self, IRLAN_EVENT event, |
267 | struct sk_buff *skb) | 267 | struct sk_buff *skb) |
268 | { | 268 | { |
269 | IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); | 269 | IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); |
270 | 270 | ||
271 | IRDA_ASSERT(self != NULL, return -1;); | 271 | IRDA_ASSERT(self != NULL, return -1;); |
272 | 272 | ||
273 | switch(event) { | 273 | switch(event) { |
@@ -289,7 +289,7 @@ static int irlan_client_state_media(struct irlan_cb *self, IRLAN_EVENT event, | |||
289 | } | 289 | } |
290 | if (skb) | 290 | if (skb) |
291 | dev_kfree_skb(skb); | 291 | dev_kfree_skb(skb); |
292 | 292 | ||
293 | return 0; | 293 | return 0; |
294 | } | 294 | } |
295 | 295 | ||
@@ -300,47 +300,47 @@ static int irlan_client_state_media(struct irlan_cb *self, IRLAN_EVENT event, | |||
300 | * reply | 300 | * reply |
301 | * | 301 | * |
302 | */ | 302 | */ |
303 | static int irlan_client_state_open(struct irlan_cb *self, IRLAN_EVENT event, | 303 | static int irlan_client_state_open(struct irlan_cb *self, IRLAN_EVENT event, |
304 | struct sk_buff *skb) | 304 | struct sk_buff *skb) |
305 | { | 305 | { |
306 | struct qos_info qos; | 306 | struct qos_info qos; |
307 | 307 | ||
308 | IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); | 308 | IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); |
309 | 309 | ||
310 | IRDA_ASSERT(self != NULL, return -1;); | 310 | IRDA_ASSERT(self != NULL, return -1;); |
311 | 311 | ||
312 | switch(event) { | 312 | switch(event) { |
313 | case IRLAN_DATA_INDICATION: | 313 | case IRLAN_DATA_INDICATION: |
314 | irlan_client_parse_response(self, skb); | 314 | irlan_client_parse_response(self, skb); |
315 | 315 | ||
316 | /* | 316 | /* |
317 | * Check if we have got the remote TSAP for data | 317 | * Check if we have got the remote TSAP for data |
318 | * communications | 318 | * communications |
319 | */ | 319 | */ |
320 | IRDA_ASSERT(self->dtsap_sel_data != 0, return -1;); | 320 | IRDA_ASSERT(self->dtsap_sel_data != 0, return -1;); |
321 | 321 | ||
322 | /* Check which access type we are dealing with */ | 322 | /* Check which access type we are dealing with */ |
323 | switch (self->client.access_type) { | 323 | switch (self->client.access_type) { |
324 | case ACCESS_PEER: | 324 | case ACCESS_PEER: |
325 | if (self->provider.state == IRLAN_OPEN) { | 325 | if (self->provider.state == IRLAN_OPEN) { |
326 | 326 | ||
327 | irlan_next_client_state(self, IRLAN_ARB); | 327 | irlan_next_client_state(self, IRLAN_ARB); |
328 | irlan_do_client_event(self, IRLAN_CHECK_CON_ARB, | 328 | irlan_do_client_event(self, IRLAN_CHECK_CON_ARB, |
329 | NULL); | 329 | NULL); |
330 | } else { | 330 | } else { |
331 | 331 | ||
332 | irlan_next_client_state(self, IRLAN_WAIT); | 332 | irlan_next_client_state(self, IRLAN_WAIT); |
333 | } | 333 | } |
334 | break; | 334 | break; |
335 | case ACCESS_DIRECT: | 335 | case ACCESS_DIRECT: |
336 | case ACCESS_HOSTED: | 336 | case ACCESS_HOSTED: |
337 | qos.link_disc_time.bits = 0x01; /* 3 secs */ | 337 | qos.link_disc_time.bits = 0x01; /* 3 secs */ |
338 | 338 | ||
339 | irttp_connect_request(self->tsap_data, | 339 | irttp_connect_request(self->tsap_data, |
340 | self->dtsap_sel_data, | 340 | self->dtsap_sel_data, |
341 | self->saddr, self->daddr, &qos, | 341 | self->saddr, self->daddr, &qos, |
342 | IRLAN_MTU, NULL); | 342 | IRLAN_MTU, NULL); |
343 | 343 | ||
344 | irlan_next_client_state(self, IRLAN_DATA); | 344 | irlan_next_client_state(self, IRLAN_DATA); |
345 | break; | 345 | break; |
346 | default: | 346 | default: |
@@ -359,7 +359,7 @@ static int irlan_client_state_open(struct irlan_cb *self, IRLAN_EVENT event, | |||
359 | IRDA_DEBUG(2, "%s(), Unknown event %d\n", __FUNCTION__ , event); | 359 | IRDA_DEBUG(2, "%s(), Unknown event %d\n", __FUNCTION__ , event); |
360 | break; | 360 | break; |
361 | } | 361 | } |
362 | 362 | ||
363 | if (skb) | 363 | if (skb) |
364 | dev_kfree_skb(skb); | 364 | dev_kfree_skb(skb); |
365 | 365 | ||
@@ -373,13 +373,13 @@ static int irlan_client_state_open(struct irlan_cb *self, IRLAN_EVENT event, | |||
373 | * provider OPEN state. | 373 | * provider OPEN state. |
374 | * | 374 | * |
375 | */ | 375 | */ |
376 | static int irlan_client_state_wait(struct irlan_cb *self, IRLAN_EVENT event, | 376 | static int irlan_client_state_wait(struct irlan_cb *self, IRLAN_EVENT event, |
377 | struct sk_buff *skb) | 377 | struct sk_buff *skb) |
378 | { | 378 | { |
379 | IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); | 379 | IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); |
380 | 380 | ||
381 | IRDA_ASSERT(self != NULL, return -1;); | 381 | IRDA_ASSERT(self != NULL, return -1;); |
382 | 382 | ||
383 | switch(event) { | 383 | switch(event) { |
384 | case IRLAN_PROVIDER_SIGNAL: | 384 | case IRLAN_PROVIDER_SIGNAL: |
385 | irlan_next_client_state(self, IRLAN_ARB); | 385 | irlan_next_client_state(self, IRLAN_ARB); |
@@ -398,36 +398,36 @@ static int irlan_client_state_wait(struct irlan_cb *self, IRLAN_EVENT event, | |||
398 | } | 398 | } |
399 | if (skb) | 399 | if (skb) |
400 | dev_kfree_skb(skb); | 400 | dev_kfree_skb(skb); |
401 | 401 | ||
402 | return 0; | 402 | return 0; |
403 | } | 403 | } |
404 | 404 | ||
405 | static int irlan_client_state_arb(struct irlan_cb *self, IRLAN_EVENT event, | 405 | static int irlan_client_state_arb(struct irlan_cb *self, IRLAN_EVENT event, |
406 | struct sk_buff *skb) | 406 | struct sk_buff *skb) |
407 | { | 407 | { |
408 | struct qos_info qos; | 408 | struct qos_info qos; |
409 | 409 | ||
410 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__ ); | 410 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__ ); |
411 | 411 | ||
412 | IRDA_ASSERT(self != NULL, return -1;); | 412 | IRDA_ASSERT(self != NULL, return -1;); |
413 | 413 | ||
414 | switch(event) { | 414 | switch(event) { |
415 | case IRLAN_CHECK_CON_ARB: | 415 | case IRLAN_CHECK_CON_ARB: |
416 | if (self->client.recv_arb_val == self->provider.send_arb_val) { | 416 | if (self->client.recv_arb_val == self->provider.send_arb_val) { |
417 | irlan_next_client_state(self, IRLAN_CLOSE); | 417 | irlan_next_client_state(self, IRLAN_CLOSE); |
418 | irlan_close_data_channel(self); | 418 | irlan_close_data_channel(self); |
419 | } else if (self->client.recv_arb_val < | 419 | } else if (self->client.recv_arb_val < |
420 | self->provider.send_arb_val) | 420 | self->provider.send_arb_val) |
421 | { | 421 | { |
422 | qos.link_disc_time.bits = 0x01; /* 3 secs */ | 422 | qos.link_disc_time.bits = 0x01; /* 3 secs */ |
423 | 423 | ||
424 | irlan_next_client_state(self, IRLAN_DATA); | 424 | irlan_next_client_state(self, IRLAN_DATA); |
425 | irttp_connect_request(self->tsap_data, | 425 | irttp_connect_request(self->tsap_data, |
426 | self->dtsap_sel_data, | 426 | self->dtsap_sel_data, |
427 | self->saddr, self->daddr, &qos, | 427 | self->saddr, self->daddr, &qos, |
428 | IRLAN_MTU, NULL); | 428 | IRLAN_MTU, NULL); |
429 | } else if (self->client.recv_arb_val > | 429 | } else if (self->client.recv_arb_val > |
430 | self->provider.send_arb_val) | 430 | self->provider.send_arb_val) |
431 | { | 431 | { |
432 | IRDA_DEBUG(2, "%s(), lost the battle :-(\n", __FUNCTION__ ); | 432 | IRDA_DEBUG(2, "%s(), lost the battle :-(\n", __FUNCTION__ ); |
433 | } | 433 | } |
@@ -448,7 +448,7 @@ static int irlan_client_state_arb(struct irlan_cb *self, IRLAN_EVENT event, | |||
448 | } | 448 | } |
449 | if (skb) | 449 | if (skb) |
450 | dev_kfree_skb(skb); | 450 | dev_kfree_skb(skb); |
451 | 451 | ||
452 | return 0; | 452 | return 0; |
453 | } | 453 | } |
454 | 454 | ||
@@ -459,8 +459,8 @@ static int irlan_client_state_arb(struct irlan_cb *self, IRLAN_EVENT event, | |||
459 | * the local and remote machines. | 459 | * the local and remote machines. |
460 | * | 460 | * |
461 | */ | 461 | */ |
462 | static int irlan_client_state_data(struct irlan_cb *self, IRLAN_EVENT event, | 462 | static int irlan_client_state_data(struct irlan_cb *self, IRLAN_EVENT event, |
463 | struct sk_buff *skb) | 463 | struct sk_buff *skb) |
464 | { | 464 | { |
465 | IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); | 465 | IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); |
466 | 466 | ||
@@ -470,7 +470,7 @@ static int irlan_client_state_data(struct irlan_cb *self, IRLAN_EVENT event, | |||
470 | switch(event) { | 470 | switch(event) { |
471 | case IRLAN_DATA_INDICATION: | 471 | case IRLAN_DATA_INDICATION: |
472 | irlan_client_parse_response(self, skb); | 472 | irlan_client_parse_response(self, skb); |
473 | break; | 473 | break; |
474 | case IRLAN_LMP_DISCONNECT: /* FALLTHROUGH */ | 474 | case IRLAN_LMP_DISCONNECT: /* FALLTHROUGH */ |
475 | case IRLAN_LAP_DISCONNECT: | 475 | case IRLAN_LAP_DISCONNECT: |
476 | irlan_next_client_state(self, IRLAN_IDLE); | 476 | irlan_next_client_state(self, IRLAN_IDLE); |
@@ -481,18 +481,18 @@ static int irlan_client_state_data(struct irlan_cb *self, IRLAN_EVENT event, | |||
481 | } | 481 | } |
482 | if (skb) | 482 | if (skb) |
483 | dev_kfree_skb(skb); | 483 | dev_kfree_skb(skb); |
484 | 484 | ||
485 | return 0; | 485 | return 0; |
486 | } | 486 | } |
487 | 487 | ||
488 | /* | 488 | /* |
489 | * Function irlan_client_state_close (self, event, skb, info) | 489 | * Function irlan_client_state_close (self, event, skb, info) |
490 | * | 490 | * |
491 | * | 491 | * |
492 | * | 492 | * |
493 | */ | 493 | */ |
494 | static int irlan_client_state_close(struct irlan_cb *self, IRLAN_EVENT event, | 494 | static int irlan_client_state_close(struct irlan_cb *self, IRLAN_EVENT event, |
495 | struct sk_buff *skb) | 495 | struct sk_buff *skb) |
496 | { | 496 | { |
497 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__ ); | 497 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__ ); |
498 | 498 | ||
@@ -505,17 +505,17 @@ static int irlan_client_state_close(struct irlan_cb *self, IRLAN_EVENT event, | |||
505 | /* | 505 | /* |
506 | * Function irlan_client_state_sync (self, event, skb, info) | 506 | * Function irlan_client_state_sync (self, event, skb, info) |
507 | * | 507 | * |
508 | * | 508 | * |
509 | * | 509 | * |
510 | */ | 510 | */ |
511 | static int irlan_client_state_sync(struct irlan_cb *self, IRLAN_EVENT event, | 511 | static int irlan_client_state_sync(struct irlan_cb *self, IRLAN_EVENT event, |
512 | struct sk_buff *skb) | 512 | struct sk_buff *skb) |
513 | { | 513 | { |
514 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__ ); | 514 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__ ); |
515 | 515 | ||
516 | if (skb) | 516 | if (skb) |
517 | dev_kfree_skb(skb); | 517 | dev_kfree_skb(skb); |
518 | 518 | ||
519 | return 0; | 519 | return 0; |
520 | } | 520 | } |
521 | 521 | ||