aboutsummaryrefslogtreecommitdiffstats
path: root/net/irda/ircomm/ircomm_ttp.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/irda/ircomm/ircomm_ttp.c')
-rw-r--r--net/irda/ircomm/ircomm_ttp.c88
1 files changed, 44 insertions, 44 deletions
diff --git a/net/irda/ircomm/ircomm_ttp.c b/net/irda/ircomm/ircomm_ttp.c
index d98bf3570d29..bb06ebaadd16 100644
--- a/net/irda/ircomm/ircomm_ttp.c
+++ b/net/irda/ircomm/ircomm_ttp.c
@@ -1,5 +1,5 @@
1/********************************************************************* 1/*********************************************************************
2 * 2 *
3 * Filename: ircomm_ttp.c 3 * Filename: ircomm_ttp.c
4 * Version: 1.0 4 * Version: 1.0
5 * Description: Interface between IrCOMM and IrTTP 5 * Description: Interface between IrCOMM and IrTTP
@@ -8,25 +8,25 @@
8 * Created at: Sun Jun 6 20:48:27 1999 8 * Created at: Sun Jun 6 20:48:27 1999
9 * Modified at: Mon Dec 13 11:35:13 1999 9 * Modified at: Mon Dec 13 11:35:13 1999
10 * Modified by: Dag Brattli <dagb@cs.uit.no> 10 * Modified by: Dag Brattli <dagb@cs.uit.no>
11 * 11 *
12 * Copyright (c) 1999 Dag Brattli, All Rights Reserved. 12 * Copyright (c) 1999 Dag Brattli, All Rights Reserved.
13 * Copyright (c) 2000-2003 Jean Tourrilhes <jt@hpl.hp.com> 13 * Copyright (c) 2000-2003 Jean Tourrilhes <jt@hpl.hp.com>
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 * This program is distributed in the hope that it will be useful, 20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details. 23 * GNU General Public License for more details.
24 * 24 *
25 * You should have received a copy of the GNU General Public License 25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software 26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
28 * MA 02111-1307 USA 28 * MA 02111-1307 USA
29 * 29 *
30 ********************************************************************/ 30 ********************************************************************/
31 31
32#include <linux/sched.h> 32#include <linux/sched.h>
@@ -43,8 +43,8 @@
43static int ircomm_ttp_data_indication(void *instance, void *sap, 43static int ircomm_ttp_data_indication(void *instance, void *sap,
44 struct sk_buff *skb); 44 struct sk_buff *skb);
45static void ircomm_ttp_connect_confirm(void *instance, void *sap, 45static void ircomm_ttp_connect_confirm(void *instance, void *sap,
46 struct qos_info *qos, 46 struct qos_info *qos,
47 __u32 max_sdu_size, 47 __u32 max_sdu_size,
48 __u8 max_header_size, 48 __u8 max_header_size,
49 struct sk_buff *skb); 49 struct sk_buff *skb);
50static void ircomm_ttp_connect_indication(void *instance, void *sap, 50static void ircomm_ttp_connect_indication(void *instance, void *sap,
@@ -54,25 +54,25 @@ static void ircomm_ttp_connect_indication(void *instance, void *sap,
54 struct sk_buff *skb); 54 struct sk_buff *skb);
55static void ircomm_ttp_flow_indication(void *instance, void *sap, 55static void ircomm_ttp_flow_indication(void *instance, void *sap,
56 LOCAL_FLOW cmd); 56 LOCAL_FLOW cmd);
57static void ircomm_ttp_disconnect_indication(void *instance, void *sap, 57static void ircomm_ttp_disconnect_indication(void *instance, void *sap,
58 LM_REASON reason, 58 LM_REASON reason,
59 struct sk_buff *skb); 59 struct sk_buff *skb);
60static int ircomm_ttp_data_request(struct ircomm_cb *self, 60static int ircomm_ttp_data_request(struct ircomm_cb *self,
61 struct sk_buff *skb, 61 struct sk_buff *skb,
62 int clen); 62 int clen);
63static int ircomm_ttp_connect_request(struct ircomm_cb *self, 63static int ircomm_ttp_connect_request(struct ircomm_cb *self,
64 struct sk_buff *userdata, 64 struct sk_buff *userdata,
65 struct ircomm_info *info); 65 struct ircomm_info *info);
66static int ircomm_ttp_connect_response(struct ircomm_cb *self, 66static int ircomm_ttp_connect_response(struct ircomm_cb *self,
67 struct sk_buff *userdata); 67 struct sk_buff *userdata);
68static int ircomm_ttp_disconnect_request(struct ircomm_cb *self, 68static int ircomm_ttp_disconnect_request(struct ircomm_cb *self,
69 struct sk_buff *userdata, 69 struct sk_buff *userdata,
70 struct ircomm_info *info); 70 struct ircomm_info *info);
71 71
72/* 72/*
73 * Function ircomm_open_tsap (self) 73 * Function ircomm_open_tsap (self)
74 * 74 *
75 * 75 *
76 * 76 *
77 */ 77 */
78int ircomm_open_tsap(struct ircomm_cb *self) 78int ircomm_open_tsap(struct ircomm_cb *self)
@@ -113,11 +113,11 @@ int ircomm_open_tsap(struct ircomm_cb *self)
113/* 113/*
114 * Function ircomm_ttp_connect_request (self, userdata) 114 * Function ircomm_ttp_connect_request (self, userdata)
115 * 115 *
116 * 116 *
117 * 117 *
118 */ 118 */
119static int ircomm_ttp_connect_request(struct ircomm_cb *self, 119static int ircomm_ttp_connect_request(struct ircomm_cb *self,
120 struct sk_buff *userdata, 120 struct sk_buff *userdata,
121 struct ircomm_info *info) 121 struct ircomm_info *info)
122{ 122{
123 int ret = 0; 123 int ret = 0;
@@ -129,16 +129,16 @@ static int ircomm_ttp_connect_request(struct ircomm_cb *self,
129 skb_get(userdata); 129 skb_get(userdata);
130 130
131 ret = irttp_connect_request(self->tsap, info->dlsap_sel, 131 ret = irttp_connect_request(self->tsap, info->dlsap_sel,
132 info->saddr, info->daddr, NULL, 132 info->saddr, info->daddr, NULL,
133 TTP_SAR_DISABLE, userdata); 133 TTP_SAR_DISABLE, userdata);
134 134
135 return ret; 135 return ret;
136} 136}
137 137
138/* 138/*
139 * Function ircomm_ttp_connect_response (self, skb) 139 * Function ircomm_ttp_connect_response (self, skb)
140 * 140 *
141 * 141 *
142 * 142 *
143 */ 143 */
144static int ircomm_ttp_connect_response(struct ircomm_cb *self, 144static int ircomm_ttp_connect_response(struct ircomm_cb *self,
@@ -147,7 +147,7 @@ static int ircomm_ttp_connect_response(struct ircomm_cb *self,
147 int ret; 147 int ret;
148 148
149 IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); 149 IRDA_DEBUG(4, "%s()\n", __FUNCTION__ );
150 150
151 /* Don't forget to refcount it - should be NULL anyway */ 151 /* Don't forget to refcount it - should be NULL anyway */
152 if(userdata) 152 if(userdata)
153 skb_get(userdata); 153 skb_get(userdata);
@@ -160,14 +160,14 @@ static int ircomm_ttp_connect_response(struct ircomm_cb *self,
160/* 160/*
161 * Function ircomm_ttp_data_request (self, userdata) 161 * Function ircomm_ttp_data_request (self, userdata)
162 * 162 *
163 * Send IrCOMM data to IrTTP layer. Currently we do not try to combine 163 * Send IrCOMM data to IrTTP layer. Currently we do not try to combine
164 * control data with pure data, so they will be sent as separate frames. 164 * control data with pure data, so they will be sent as separate frames.
165 * Should not be a big problem though, since control frames are rare. But 165 * Should not be a big problem though, since control frames are rare. But
166 * some of them are sent after connection establishment, so this can 166 * some of them are sent after connection establishment, so this can
167 * increase the latency a bit. 167 * increase the latency a bit.
168 */ 168 */
169static int ircomm_ttp_data_request(struct ircomm_cb *self, 169static int ircomm_ttp_data_request(struct ircomm_cb *self,
170 struct sk_buff *skb, 170 struct sk_buff *skb,
171 int clen) 171 int clen)
172{ 172{
173 int ret; 173 int ret;
@@ -176,7 +176,7 @@ static int ircomm_ttp_data_request(struct ircomm_cb *self,
176 176
177 IRDA_DEBUG(2, "%s(), clen=%d\n", __FUNCTION__ , clen); 177 IRDA_DEBUG(2, "%s(), clen=%d\n", __FUNCTION__ , clen);
178 178
179 /* 179 /*
180 * Insert clen field, currently we either send data only, or control 180 * Insert clen field, currently we either send data only, or control
181 * only frames, to make things easier and avoid queueing 181 * only frames, to make things easier and avoid queueing
182 */ 182 */
@@ -210,7 +210,7 @@ static int ircomm_ttp_data_indication(void *instance, void *sap,
210 struct ircomm_cb *self = (struct ircomm_cb *) instance; 210 struct ircomm_cb *self = (struct ircomm_cb *) instance;
211 211
212 IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); 212 IRDA_DEBUG(4, "%s()\n", __FUNCTION__ );
213 213
214 IRDA_ASSERT(self != NULL, return -1;); 214 IRDA_ASSERT(self != NULL, return -1;);
215 IRDA_ASSERT(self->magic == IRCOMM_MAGIC, return -1;); 215 IRDA_ASSERT(self->magic == IRCOMM_MAGIC, return -1;);
216 IRDA_ASSERT(skb != NULL, return -1;); 216 IRDA_ASSERT(skb != NULL, return -1;);
@@ -224,8 +224,8 @@ static int ircomm_ttp_data_indication(void *instance, void *sap,
224} 224}
225 225
226static void ircomm_ttp_connect_confirm(void *instance, void *sap, 226static void ircomm_ttp_connect_confirm(void *instance, void *sap,
227 struct qos_info *qos, 227 struct qos_info *qos,
228 __u32 max_sdu_size, 228 __u32 max_sdu_size,
229 __u8 max_header_size, 229 __u8 max_header_size,
230 struct sk_buff *skb) 230 struct sk_buff *skb)
231{ 231{
@@ -261,7 +261,7 @@ out:
261 * Function ircomm_ttp_connect_indication (instance, sap, qos, max_sdu_size, 261 * Function ircomm_ttp_connect_indication (instance, sap, qos, max_sdu_size,
262 * max_header_size, skb) 262 * max_header_size, skb)
263 * 263 *
264 * 264 *
265 * 265 *
266 */ 266 */
267static void ircomm_ttp_connect_indication(void *instance, void *sap, 267static void ircomm_ttp_connect_indication(void *instance, void *sap,
@@ -301,11 +301,11 @@ out:
301/* 301/*
302 * Function ircomm_ttp_disconnect_request (self, userdata, info) 302 * Function ircomm_ttp_disconnect_request (self, userdata, info)
303 * 303 *
304 * 304 *
305 * 305 *
306 */ 306 */
307static int ircomm_ttp_disconnect_request(struct ircomm_cb *self, 307static int ircomm_ttp_disconnect_request(struct ircomm_cb *self,
308 struct sk_buff *userdata, 308 struct sk_buff *userdata,
309 struct ircomm_info *info) 309 struct ircomm_info *info)
310{ 310{
311 int ret; 311 int ret;
@@ -322,10 +322,10 @@ static int ircomm_ttp_disconnect_request(struct ircomm_cb *self,
322/* 322/*
323 * Function ircomm_ttp_disconnect_indication (instance, sap, reason, skb) 323 * Function ircomm_ttp_disconnect_indication (instance, sap, reason, skb)
324 * 324 *
325 * 325 *
326 * 326 *
327 */ 327 */
328static void ircomm_ttp_disconnect_indication(void *instance, void *sap, 328static void ircomm_ttp_disconnect_indication(void *instance, void *sap,
329 LM_REASON reason, 329 LM_REASON reason,
330 struct sk_buff *skb) 330 struct sk_buff *skb)
331{ 331{
@@ -361,7 +361,7 @@ static void ircomm_ttp_flow_indication(void *instance, void *sap,
361 361
362 IRDA_ASSERT(self != NULL, return;); 362 IRDA_ASSERT(self != NULL, return;);
363 IRDA_ASSERT(self->magic == IRCOMM_MAGIC, return;); 363 IRDA_ASSERT(self->magic == IRCOMM_MAGIC, return;);
364 364
365 if (self->notify.flow_indication) 365 if (self->notify.flow_indication)
366 self->notify.flow_indication(self->notify.instance, self, cmd); 366 self->notify.flow_indication(self->notify.instance, self, cmd);
367} 367}