aboutsummaryrefslogtreecommitdiffstats
path: root/net/irda/irlan/irlan_provider_event.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/irda/irlan/irlan_provider_event.c')
-rw-r--r--net/irda/irlan/irlan_provider_event.c68
1 files changed, 34 insertions, 34 deletions
diff --git a/net/irda/irlan/irlan_provider_event.c b/net/irda/irlan/irlan_provider_event.c
index 5a086f9827ed..ef401bd6ea00 100644
--- a/net/irda/irlan/irlan_provider_event.c
+++ b/net/irda/irlan/irlan_provider_event.c
@@ -1,5 +1,5 @@
1/********************************************************************* 1/*********************************************************************
2 * 2 *
3 * Filename: irlan_provider_event.c 3 * Filename: irlan_provider_event.c
4 * Version: 0.9 4 * Version: 0.9
5 * Description: IrLAN provider state machine) 5 * Description: IrLAN provider state machine)
@@ -8,16 +8,16 @@
8 * Created at: Sun Aug 31 20:14:37 1997 8 * Created at: Sun Aug 31 20:14:37 1997
9 * Modified at: Sat Oct 30 12:52:41 1999 9 * Modified at: Sat Oct 30 12:52:41 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>, All Rights Reserved. 12 * Copyright (c) 1998-1999 Dag Brattli <dagb@cs.uit.no>, All Rights Reserved.
13 * 13 *
14 * This program is free software; you can redistribute it and/or 14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as 15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of 16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version. 17 * the License, or (at your option) any later version.
18 * 18 *
19 * Neither Dag Brattli nor University of Tromsų admit liability nor 19 * Neither Dag Brattli nor University of Tromsų admit liability nor
20 * provide warranty for any of this software. This material is 20 * provide warranty for any of this software. This material is
21 * provided "AS-IS" and at no charge. 21 * provided "AS-IS" and at no charge.
22 * 22 *
23 ********************************************************************/ 23 ********************************************************************/
@@ -30,18 +30,18 @@
30#include <net/irda/irlan_provider.h> 30#include <net/irda/irlan_provider.h>
31#include <net/irda/irlan_event.h> 31#include <net/irda/irlan_event.h>
32 32
33static int irlan_provider_state_idle(struct irlan_cb *self, IRLAN_EVENT event, 33static int irlan_provider_state_idle(struct irlan_cb *self, IRLAN_EVENT event,
34 struct sk_buff *skb); 34 struct sk_buff *skb);
35static int irlan_provider_state_info(struct irlan_cb *self, IRLAN_EVENT event, 35static int irlan_provider_state_info(struct irlan_cb *self, IRLAN_EVENT event,
36 struct sk_buff *skb); 36 struct sk_buff *skb);
37static int irlan_provider_state_open(struct irlan_cb *self, IRLAN_EVENT event, 37static int irlan_provider_state_open(struct irlan_cb *self, IRLAN_EVENT event,
38 struct sk_buff *skb); 38 struct sk_buff *skb);
39static int irlan_provider_state_data(struct irlan_cb *self, IRLAN_EVENT event, 39static int irlan_provider_state_data(struct irlan_cb *self, IRLAN_EVENT event,
40 struct sk_buff *skb); 40 struct sk_buff *skb);
41 41
42static int (*state[])(struct irlan_cb *self, IRLAN_EVENT event, 42static int (*state[])(struct irlan_cb *self, IRLAN_EVENT event,
43 struct sk_buff *skb) = 43 struct sk_buff *skb) =
44{ 44{
45 irlan_provider_state_idle, 45 irlan_provider_state_idle,
46 NULL, /* Query */ 46 NULL, /* Query */
47 NULL, /* Info */ 47 NULL, /* Info */
@@ -55,8 +55,8 @@ static int (*state[])(struct irlan_cb *self, IRLAN_EVENT event,
55 NULL, /* Sync */ 55 NULL, /* Sync */
56}; 56};
57 57
58void irlan_do_provider_event(struct irlan_cb *self, IRLAN_EVENT event, 58void irlan_do_provider_event(struct irlan_cb *self, IRLAN_EVENT event,
59 struct sk_buff *skb) 59 struct sk_buff *skb)
60{ 60{
61 IRDA_ASSERT(*state[ self->provider.state] != NULL, return;); 61 IRDA_ASSERT(*state[ self->provider.state] != NULL, return;);
62 62
@@ -73,9 +73,9 @@ static int irlan_provider_state_idle(struct irlan_cb *self, IRLAN_EVENT event,
73 struct sk_buff *skb) 73 struct sk_buff *skb)
74{ 74{
75 IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); 75 IRDA_DEBUG(4, "%s()\n", __FUNCTION__ );
76 76
77 IRDA_ASSERT(self != NULL, return -1;); 77 IRDA_ASSERT(self != NULL, return -1;);
78 78
79 switch(event) { 79 switch(event) {
80 case IRLAN_CONNECT_INDICATION: 80 case IRLAN_CONNECT_INDICATION:
81 irlan_provider_connect_response( self, self->provider.tsap_ctrl); 81 irlan_provider_connect_response( self, self->provider.tsap_ctrl);
@@ -96,13 +96,13 @@ static int irlan_provider_state_idle(struct irlan_cb *self, IRLAN_EVENT event,
96 * 96 *
97 * INFO, We have issued a GetInfo command and is awaiting a reply. 97 * INFO, We have issued a GetInfo command and is awaiting a reply.
98 */ 98 */
99static int irlan_provider_state_info(struct irlan_cb *self, IRLAN_EVENT event, 99static int irlan_provider_state_info(struct irlan_cb *self, IRLAN_EVENT event,
100 struct sk_buff *skb) 100 struct sk_buff *skb)
101{ 101{
102 int ret; 102 int ret;
103 103
104 IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); 104 IRDA_DEBUG(4, "%s()\n", __FUNCTION__ );
105 105
106 IRDA_ASSERT(self != NULL, return -1;); 106 IRDA_ASSERT(self != NULL, return -1;);
107 107
108 switch(event) { 108 switch(event) {
@@ -110,7 +110,7 @@ static int irlan_provider_state_info(struct irlan_cb *self, IRLAN_EVENT event,
110 /* Be sure to use 802.3 in case of peer mode */ 110 /* Be sure to use 802.3 in case of peer mode */
111 if (self->provider.access_type == ACCESS_PEER) { 111 if (self->provider.access_type == ACCESS_PEER) {
112 self->media = MEDIA_802_3; 112 self->media = MEDIA_802_3;
113 113
114 /* Check if client has started yet */ 114 /* Check if client has started yet */
115 if (self->client.state == IRLAN_IDLE) { 115 if (self->client.state == IRLAN_IDLE) {
116 /* This should get the client going */ 116 /* This should get the client going */
@@ -118,15 +118,15 @@ static int irlan_provider_state_info(struct irlan_cb *self, IRLAN_EVENT event,
118 } 118 }
119 } 119 }
120 120
121 irlan_provider_send_reply(self, CMD_GET_PROVIDER_INFO, 121 irlan_provider_send_reply(self, CMD_GET_PROVIDER_INFO,
122 RSP_SUCCESS); 122 RSP_SUCCESS);
123 /* Keep state */ 123 /* Keep state */
124 break; 124 break;
125 case IRLAN_GET_MEDIA_CMD: 125 case IRLAN_GET_MEDIA_CMD:
126 irlan_provider_send_reply(self, CMD_GET_MEDIA_CHAR, 126 irlan_provider_send_reply(self, CMD_GET_MEDIA_CHAR,
127 RSP_SUCCESS); 127 RSP_SUCCESS);
128 /* Keep state */ 128 /* Keep state */
129 break; 129 break;
130 case IRLAN_OPEN_DATA_CMD: 130 case IRLAN_OPEN_DATA_CMD:
131 ret = irlan_parse_open_data_cmd(self, skb); 131 ret = irlan_parse_open_data_cmd(self, skb);
132 if (self->provider.access_type == ACCESS_PEER) { 132 if (self->provider.access_type == ACCESS_PEER) {
@@ -152,7 +152,7 @@ static int irlan_provider_state_info(struct irlan_cb *self, IRLAN_EVENT event,
152 } 152 }
153 if (skb) 153 if (skb)
154 dev_kfree_skb(skb); 154 dev_kfree_skb(skb);
155 155
156 return 0; 156 return 0;
157} 157}
158 158
@@ -163,7 +163,7 @@ static int irlan_provider_state_info(struct irlan_cb *self, IRLAN_EVENT event,
163 * reply 163 * reply
164 * 164 *
165 */ 165 */
166static int irlan_provider_state_open(struct irlan_cb *self, IRLAN_EVENT event, 166static int irlan_provider_state_open(struct irlan_cb *self, IRLAN_EVENT event,
167 struct sk_buff *skb) 167 struct sk_buff *skb)
168{ 168{
169 IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); 169 IRDA_DEBUG(4, "%s()\n", __FUNCTION__ );
@@ -173,11 +173,11 @@ static int irlan_provider_state_open(struct irlan_cb *self, IRLAN_EVENT event,
173 switch(event) { 173 switch(event) {
174 case IRLAN_FILTER_CONFIG_CMD: 174 case IRLAN_FILTER_CONFIG_CMD:
175 irlan_provider_parse_command(self, CMD_FILTER_OPERATION, skb); 175 irlan_provider_parse_command(self, CMD_FILTER_OPERATION, skb);
176 irlan_provider_send_reply(self, CMD_FILTER_OPERATION, 176 irlan_provider_send_reply(self, CMD_FILTER_OPERATION,
177 RSP_SUCCESS); 177 RSP_SUCCESS);
178 /* Keep state */ 178 /* Keep state */
179 break; 179 break;
180 case IRLAN_DATA_CONNECT_INDICATION: 180 case IRLAN_DATA_CONNECT_INDICATION:
181 irlan_next_provider_state(self, IRLAN_DATA); 181 irlan_next_provider_state(self, IRLAN_DATA);
182 irlan_provider_connect_response(self, self->tsap_data); 182 irlan_provider_connect_response(self, self->tsap_data);
183 break; 183 break;
@@ -202,8 +202,8 @@ static int irlan_provider_state_open(struct irlan_cb *self, IRLAN_EVENT event,
202 * the local and remote machines. 202 * the local and remote machines.
203 * 203 *
204 */ 204 */
205static int irlan_provider_state_data(struct irlan_cb *self, IRLAN_EVENT event, 205static int irlan_provider_state_data(struct irlan_cb *self, IRLAN_EVENT event,
206 struct sk_buff *skb) 206 struct sk_buff *skb)
207{ 207{
208 IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); 208 IRDA_DEBUG(4, "%s()\n", __FUNCTION__ );
209 209
@@ -213,7 +213,7 @@ static int irlan_provider_state_data(struct irlan_cb *self, IRLAN_EVENT event,
213 switch(event) { 213 switch(event) {
214 case IRLAN_FILTER_CONFIG_CMD: 214 case IRLAN_FILTER_CONFIG_CMD:
215 irlan_provider_parse_command(self, CMD_FILTER_OPERATION, skb); 215 irlan_provider_parse_command(self, CMD_FILTER_OPERATION, skb);
216 irlan_provider_send_reply(self, CMD_FILTER_OPERATION, 216 irlan_provider_send_reply(self, CMD_FILTER_OPERATION,
217 RSP_SUCCESS); 217 RSP_SUCCESS);
218 break; 218 break;
219 case IRLAN_LMP_DISCONNECT: /* FALLTHROUGH */ 219 case IRLAN_LMP_DISCONNECT: /* FALLTHROUGH */
@@ -226,7 +226,7 @@ static int irlan_provider_state_data(struct irlan_cb *self, IRLAN_EVENT event,
226 } 226 }
227 if (skb) 227 if (skb)
228 dev_kfree_skb(skb); 228 dev_kfree_skb(skb);
229 229
230 return 0; 230 return 0;
231} 231}
232 232