aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/gigaset/i4l.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn/gigaset/i4l.c')
-rw-r--r--drivers/isdn/gigaset/i4l.c178
1 files changed, 93 insertions, 85 deletions
diff --git a/drivers/isdn/gigaset/i4l.c b/drivers/isdn/gigaset/i4l.c
index e30275d4e148..cc1d3093e433 100644
--- a/drivers/isdn/gigaset/i4l.c
+++ b/drivers/isdn/gigaset/i4l.c
@@ -15,7 +15,7 @@
15 15
16#include "gigaset.h" 16#include "gigaset.h"
17 17
18/* == Handling of I4L IO ============================================================================*/ 18/* == Handling of I4L IO =====================================================*/
19 19
20/* writebuf_from_LL 20/* writebuf_from_LL
21 * called by LL to transmit data on an open channel 21 * called by LL to transmit data on an open channel
@@ -33,7 +33,8 @@
33 * 0 if temporarily unable to accept data (out of buffer space) 33 * 0 if temporarily unable to accept data (out of buffer space)
34 * <0 on error (eg. -EINVAL) 34 * <0 on error (eg. -EINVAL)
35 */ 35 */
36static int writebuf_from_LL(int driverID, int channel, int ack, struct sk_buff *skb) 36static int writebuf_from_LL(int driverID, int channel, int ack,
37 struct sk_buff *skb)
37{ 38{
38 struct cardstate *cs; 39 struct cardstate *cs;
39 struct bc_state *bcs; 40 struct bc_state *bcs;
@@ -51,28 +52,30 @@ static int writebuf_from_LL(int driverID, int channel, int ack, struct sk_buff *
51 bcs = &cs->bcs[channel]; 52 bcs = &cs->bcs[channel];
52 len = skb->len; 53 len = skb->len;
53 54
54 dbg(DEBUG_LLDATA, 55 gig_dbg(DEBUG_LLDATA,
55 "Receiving data from LL (id: %d, channel: %d, ack: %d, size: %d)", 56 "Receiving data from LL (id: %d, ch: %d, ack: %d, sz: %d)",
56 driverID, channel, ack, len); 57 driverID, channel, ack, len);
58
59 if (!atomic_read(&cs->connected)) {
60 err("%s: disconnected", __func__);
61 return -ENODEV;
62 }
57 63
58 if (!len) { 64 if (!len) {
59 if (ack) 65 if (ack)
60 warn("not ACKing empty packet from LL"); 66 notice("%s: not ACKing empty packet", __func__);
61 return 0; 67 return 0;
62 } 68 }
63 if (len > MAX_BUF_SIZE) { 69 if (len > MAX_BUF_SIZE) {
64 err("%s: packet too large (%d bytes)", __func__, channel); 70 err("%s: packet too large (%d bytes)", __func__, len);
65 return -EINVAL; 71 return -EINVAL;
66 } 72 }
67 73
68 if (!atomic_read(&cs->connected))
69 return -ENODEV;
70
71 skblen = ack ? len : 0; 74 skblen = ack ? len : 0;
72 skb->head[0] = skblen & 0xff; 75 skb->head[0] = skblen & 0xff;
73 skb->head[1] = skblen >> 8; 76 skb->head[1] = skblen >> 8;
74 dbg(DEBUG_MCMD, "skb: len=%u, skblen=%u: %02x %02x", len, skblen, 77 gig_dbg(DEBUG_MCMD, "skb: len=%u, skblen=%u: %02x %02x",
75 (unsigned) skb->head[0], (unsigned) skb->head[1]); 78 len, skblen, (unsigned) skb->head[0], (unsigned) skb->head[1]);
76 79
77 /* pass to device-specific module */ 80 /* pass to device-specific module */
78 return cs->ops->send_skb(bcs, skb); 81 return cs->ops->send_skb(bcs, skb);
@@ -86,14 +89,14 @@ void gigaset_skb_sent(struct bc_state *bcs, struct sk_buff *skb)
86 ++bcs->trans_up; 89 ++bcs->trans_up;
87 90
88 if (skb->len) 91 if (skb->len)
89 warn("%s: skb->len==%d", __func__, skb->len); 92 dev_warn(bcs->cs->dev, "%s: skb->len==%d\n",
93 __func__, skb->len);
90 94
91 len = (unsigned char) skb->head[0] | 95 len = (unsigned char) skb->head[0] |
92 (unsigned) (unsigned char) skb->head[1] << 8; 96 (unsigned) (unsigned char) skb->head[1] << 8;
93 if (len) { 97 if (len) {
94 dbg(DEBUG_MCMD, 98 gig_dbg(DEBUG_MCMD, "ACKing to LL (id: %d, ch: %d, sz: %u)",
95 "Acknowledge sending to LL (id: %d, channel: %d size: %u)", 99 bcs->cs->myid, bcs->channel, len);
96 bcs->cs->myid, bcs->channel, len);
97 100
98 response.driver = bcs->cs->myid; 101 response.driver = bcs->cs->myid;
99 response.command = ISDN_STAT_BSENT; 102 response.command = ISDN_STAT_BSENT;
@@ -117,7 +120,6 @@ static int command_from_LL(isdn_ctrl *cntrl)
117 int retval = 0; 120 int retval = 0;
118 struct setup_parm *sp; 121 struct setup_parm *sp;
119 122
120 //dbg(DEBUG_ANY, "Gigaset_HW: Receiving command");
121 gigaset_debugdrivers(); 123 gigaset_debugdrivers();
122 124
123 //FIXME "remove test for &connected" 125 //FIXME "remove test for &connected"
@@ -129,29 +131,30 @@ static int command_from_LL(isdn_ctrl *cntrl)
129 131
130 switch (cntrl->command) { 132 switch (cntrl->command) {
131 case ISDN_CMD_IOCTL: 133 case ISDN_CMD_IOCTL:
132 134 gig_dbg(DEBUG_ANY, "ISDN_CMD_IOCTL (driver: %d, arg: %ld)",
133 dbg(DEBUG_ANY, "ISDN_CMD_IOCTL (driver:%d,arg: %ld)", 135 cntrl->driver, cntrl->arg);
134 cntrl->driver, cntrl->arg);
135 136
136 warn("ISDN_CMD_IOCTL is not supported."); 137 warn("ISDN_CMD_IOCTL is not supported.");
137 return -EINVAL; 138 return -EINVAL;
138 139
139 case ISDN_CMD_DIAL: 140 case ISDN_CMD_DIAL:
140 dbg(DEBUG_ANY, "ISDN_CMD_DIAL (driver: %d, channel: %ld, " 141 gig_dbg(DEBUG_ANY,
141 "phone: %s,ownmsn: %s, si1: %d, si2: %d)", 142 "ISDN_CMD_DIAL (driver: %d, ch: %ld, "
142 cntrl->driver, cntrl->arg, 143 "phone: %s, ownmsn: %s, si1: %d, si2: %d)",
143 cntrl->parm.setup.phone, cntrl->parm.setup.eazmsn, 144 cntrl->driver, cntrl->arg,
144 cntrl->parm.setup.si1, cntrl->parm.setup.si2); 145 cntrl->parm.setup.phone, cntrl->parm.setup.eazmsn,
146 cntrl->parm.setup.si1, cntrl->parm.setup.si2);
145 147
146 if (cntrl->arg >= cs->channels) { 148 if (cntrl->arg >= cs->channels) {
147 err("invalid channel (%d)", (int) cntrl->arg); 149 err("ISDN_CMD_DIAL: invalid channel (%d)",
150 (int) cntrl->arg);
148 return -EINVAL; 151 return -EINVAL;
149 } 152 }
150 153
151 bcs = cs->bcs + cntrl->arg; 154 bcs = cs->bcs + cntrl->arg;
152 155
153 if (!gigaset_get_channel(bcs)) { 156 if (!gigaset_get_channel(bcs)) {
154 err("channel not free"); 157 err("ISDN_CMD_DIAL: channel not free");
155 return -EBUSY; 158 return -EBUSY;
156 } 159 }
157 160
@@ -164,41 +167,42 @@ static int command_from_LL(isdn_ctrl *cntrl)
164 *sp = cntrl->parm.setup; 167 *sp = cntrl->parm.setup;
165 168
166 if (!gigaset_add_event(cs, &bcs->at_state, EV_DIAL, sp, 169 if (!gigaset_add_event(cs, &bcs->at_state, EV_DIAL, sp,
167 atomic_read(&bcs->at_state.seq_index), 170 atomic_read(&bcs->at_state.seq_index),
168 NULL)) { 171 NULL)) {
169 //FIXME what should we do? 172 //FIXME what should we do?
170 kfree(sp); 173 kfree(sp);
171 gigaset_free_channel(bcs); 174 gigaset_free_channel(bcs);
172 return -ENOMEM; 175 return -ENOMEM;
173 } 176 }
174 177
175 dbg(DEBUG_CMD, "scheduling DIAL"); 178 gig_dbg(DEBUG_CMD, "scheduling DIAL");
176 gigaset_schedule_event(cs); 179 gigaset_schedule_event(cs);
177 break; 180 break;
178 case ISDN_CMD_ACCEPTD: //FIXME 181 case ISDN_CMD_ACCEPTD: //FIXME
179 dbg(DEBUG_ANY, "ISDN_CMD_ACCEPTD"); 182 gig_dbg(DEBUG_ANY, "ISDN_CMD_ACCEPTD");
180 183
181 if (cntrl->arg >= cs->channels) { 184 if (cntrl->arg >= cs->channels) {
182 err("invalid channel (%d)", (int) cntrl->arg); 185 err("ISDN_CMD_ACCEPTD: invalid channel (%d)",
186 (int) cntrl->arg);
183 return -EINVAL; 187 return -EINVAL;
184 } 188 }
185 189
186 if (!gigaset_add_event(cs, &cs->bcs[cntrl->arg].at_state, 190 if (!gigaset_add_event(cs, &cs->bcs[cntrl->arg].at_state,
187 EV_ACCEPT, NULL, 0, NULL)) { 191 EV_ACCEPT, NULL, 0, NULL)) {
188 //FIXME what should we do? 192 //FIXME what should we do?
189 return -ENOMEM; 193 return -ENOMEM;
190 } 194 }
191 195
192 dbg(DEBUG_CMD, "scheduling ACCEPT"); 196 gig_dbg(DEBUG_CMD, "scheduling ACCEPT");
193 gigaset_schedule_event(cs); 197 gigaset_schedule_event(cs);
194 198
195 break; 199 break;
196 case ISDN_CMD_ACCEPTB: 200 case ISDN_CMD_ACCEPTB:
197 dbg(DEBUG_ANY, "ISDN_CMD_ACCEPTB"); 201 gig_dbg(DEBUG_ANY, "ISDN_CMD_ACCEPTB");
198 break; 202 break;
199 case ISDN_CMD_HANGUP: 203 case ISDN_CMD_HANGUP:
200 dbg(DEBUG_ANY, 204 gig_dbg(DEBUG_ANY, "ISDN_CMD_HANGUP (ch: %d)",
201 "ISDN_CMD_HANGUP (channel: %d)", (int) cntrl->arg); 205 (int) cntrl->arg);
202 206
203 if (cntrl->arg >= cs->channels) { 207 if (cntrl->arg >= cs->channels) {
204 err("ISDN_CMD_HANGUP: invalid channel (%u)", 208 err("ISDN_CMD_HANGUP: invalid channel (%u)",
@@ -207,66 +211,68 @@ static int command_from_LL(isdn_ctrl *cntrl)
207 } 211 }
208 212
209 if (!gigaset_add_event(cs, &cs->bcs[cntrl->arg].at_state, 213 if (!gigaset_add_event(cs, &cs->bcs[cntrl->arg].at_state,
210 EV_HUP, NULL, 0, NULL)) { 214 EV_HUP, NULL, 0, NULL)) {
211 //FIXME what should we do? 215 //FIXME what should we do?
212 return -ENOMEM; 216 return -ENOMEM;
213 } 217 }
214 218
215 dbg(DEBUG_CMD, "scheduling HUP"); 219 gig_dbg(DEBUG_CMD, "scheduling HUP");
216 gigaset_schedule_event(cs); 220 gigaset_schedule_event(cs);
217 221
218 break; 222 break;
219 case ISDN_CMD_CLREAZ: /* Do not signal incoming signals */ //FIXME 223 case ISDN_CMD_CLREAZ: /* Do not signal incoming signals */ //FIXME
220 dbg(DEBUG_ANY, "ISDN_CMD_CLREAZ"); 224 gig_dbg(DEBUG_ANY, "ISDN_CMD_CLREAZ");
221 break; 225 break;
222 case ISDN_CMD_SETEAZ: /* Signal incoming calls for given MSN */ //FIXME 226 case ISDN_CMD_SETEAZ: /* Signal incoming calls for given MSN */ //FIXME
223 dbg(DEBUG_ANY, 227 gig_dbg(DEBUG_ANY,
224 "ISDN_CMD_SETEAZ (id:%d, channel: %ld, number: %s)", 228 "ISDN_CMD_SETEAZ (id: %d, ch: %ld, number: %s)",
225 cntrl->driver, cntrl->arg, cntrl->parm.num); 229 cntrl->driver, cntrl->arg, cntrl->parm.num);
226 break; 230 break;
227 case ISDN_CMD_SETL2: /* Set L2 to given protocol */ 231 case ISDN_CMD_SETL2: /* Set L2 to given protocol */
228 dbg(DEBUG_ANY, "ISDN_CMD_SETL2 (Channel: %ld, Proto: %lx)", 232 gig_dbg(DEBUG_ANY, "ISDN_CMD_SETL2 (ch: %ld, proto: %lx)",
229 cntrl->arg & 0xff, (cntrl->arg >> 8)); 233 cntrl->arg & 0xff, (cntrl->arg >> 8));
230 234
231 if ((cntrl->arg & 0xff) >= cs->channels) { 235 if ((cntrl->arg & 0xff) >= cs->channels) {
232 err("invalid channel (%u)", 236 err("ISDN_CMD_SETL2: invalid channel (%u)",
233 (unsigned) cntrl->arg & 0xff); 237 (unsigned) cntrl->arg & 0xff);
234 return -EINVAL; 238 return -EINVAL;
235 } 239 }
236 240
237 if (!gigaset_add_event(cs, &cs->bcs[cntrl->arg & 0xff].at_state, 241 if (!gigaset_add_event(cs, &cs->bcs[cntrl->arg & 0xff].at_state,
238 EV_PROTO_L2, NULL, cntrl->arg >> 8, 242 EV_PROTO_L2, NULL, cntrl->arg >> 8,
239 NULL)) { 243 NULL)) {
240 //FIXME what should we do? 244 //FIXME what should we do?
241 return -ENOMEM; 245 return -ENOMEM;
242 } 246 }
243 247
244 dbg(DEBUG_CMD, "scheduling PROTO_L2"); 248 gig_dbg(DEBUG_CMD, "scheduling PROTO_L2");
245 gigaset_schedule_event(cs); 249 gigaset_schedule_event(cs);
246 break; 250 break;
247 case ISDN_CMD_SETL3: /* Set L3 to given protocol */ 251 case ISDN_CMD_SETL3: /* Set L3 to given protocol */
248 dbg(DEBUG_ANY, "ISDN_CMD_SETL3 (Channel: %ld, Proto: %lx)", 252 gig_dbg(DEBUG_ANY, "ISDN_CMD_SETL3 (ch: %ld, proto: %lx)",
249 cntrl->arg & 0xff, (cntrl->arg >> 8)); 253 cntrl->arg & 0xff, (cntrl->arg >> 8));
250 254
251 if ((cntrl->arg & 0xff) >= cs->channels) { 255 if ((cntrl->arg & 0xff) >= cs->channels) {
252 err("invalid channel (%u)", 256 err("ISDN_CMD_SETL3: invalid channel (%u)",
253 (unsigned) cntrl->arg & 0xff); 257 (unsigned) cntrl->arg & 0xff);
254 return -EINVAL; 258 return -EINVAL;
255 } 259 }
256 260
257 if (cntrl->arg >> 8 != ISDN_PROTO_L3_TRANS) { 261 if (cntrl->arg >> 8 != ISDN_PROTO_L3_TRANS) {
258 err("invalid protocol %lu", cntrl->arg >> 8); 262 err("ISDN_CMD_SETL3: invalid protocol %lu",
263 cntrl->arg >> 8);
259 return -EINVAL; 264 return -EINVAL;
260 } 265 }
261 266
262 break; 267 break;
263 case ISDN_CMD_PROCEED: 268 case ISDN_CMD_PROCEED:
264 dbg(DEBUG_ANY, "ISDN_CMD_PROCEED"); //FIXME 269 gig_dbg(DEBUG_ANY, "ISDN_CMD_PROCEED"); //FIXME
265 break; 270 break;
266 case ISDN_CMD_ALERT: 271 case ISDN_CMD_ALERT:
267 dbg(DEBUG_ANY, "ISDN_CMD_ALERT"); //FIXME 272 gig_dbg(DEBUG_ANY, "ISDN_CMD_ALERT"); //FIXME
268 if (cntrl->arg >= cs->channels) { 273 if (cntrl->arg >= cs->channels) {
269 err("invalid channel (%d)", (int) cntrl->arg); 274 err("ISDN_CMD_ALERT: invalid channel (%d)",
275 (int) cntrl->arg);
270 return -EINVAL; 276 return -EINVAL;
271 } 277 }
272 //bcs = cs->bcs + cntrl->arg; 278 //bcs = cs->bcs + cntrl->arg;
@@ -274,32 +280,31 @@ static int command_from_LL(isdn_ctrl *cntrl)
274 // FIXME 280 // FIXME
275 break; 281 break;
276 case ISDN_CMD_REDIR: 282 case ISDN_CMD_REDIR:
277 dbg(DEBUG_ANY, "ISDN_CMD_REDIR"); //FIXME 283 gig_dbg(DEBUG_ANY, "ISDN_CMD_REDIR"); //FIXME
278 break; 284 break;
279 case ISDN_CMD_PROT_IO: 285 case ISDN_CMD_PROT_IO:
280 dbg(DEBUG_ANY, "ISDN_CMD_PROT_IO"); 286 gig_dbg(DEBUG_ANY, "ISDN_CMD_PROT_IO");
281 break; 287 break;
282 case ISDN_CMD_FAXCMD: 288 case ISDN_CMD_FAXCMD:
283 dbg(DEBUG_ANY, "ISDN_CMD_FAXCMD"); 289 gig_dbg(DEBUG_ANY, "ISDN_CMD_FAXCMD");
284 break; 290 break;
285 case ISDN_CMD_GETL2: 291 case ISDN_CMD_GETL2:
286 dbg(DEBUG_ANY, "ISDN_CMD_GETL2"); 292 gig_dbg(DEBUG_ANY, "ISDN_CMD_GETL2");
287 break; 293 break;
288 case ISDN_CMD_GETL3: 294 case ISDN_CMD_GETL3:
289 dbg(DEBUG_ANY, "ISDN_CMD_GETL3"); 295 gig_dbg(DEBUG_ANY, "ISDN_CMD_GETL3");
290 break; 296 break;
291 case ISDN_CMD_GETEAZ: 297 case ISDN_CMD_GETEAZ:
292 dbg(DEBUG_ANY, "ISDN_CMD_GETEAZ"); 298 gig_dbg(DEBUG_ANY, "ISDN_CMD_GETEAZ");
293 break; 299 break;
294 case ISDN_CMD_SETSIL: 300 case ISDN_CMD_SETSIL:
295 dbg(DEBUG_ANY, "ISDN_CMD_SETSIL"); 301 gig_dbg(DEBUG_ANY, "ISDN_CMD_SETSIL");
296 break; 302 break;
297 case ISDN_CMD_GETSIL: 303 case ISDN_CMD_GETSIL:
298 dbg(DEBUG_ANY, "ISDN_CMD_GETSIL"); 304 gig_dbg(DEBUG_ANY, "ISDN_CMD_GETSIL");
299 break; 305 break;
300 default: 306 default:
301 err("unknown command %d from LL", 307 err("unknown command %d from LL", cntrl->command);
302 cntrl->command);
303 return -EINVAL; 308 return -EINVAL;
304 } 309 }
305 310
@@ -344,7 +349,8 @@ int gigaset_isdn_setup_dial(struct at_state_t *at_state, void *data)
344 proto = 2; /* 0: Bitsynchron, 1: HDLC, 2: voice */ 349 proto = 2; /* 0: Bitsynchron, 1: HDLC, 2: voice */
345 break; 350 break;
346 default: 351 default:
347 err("invalid protocol: %u", bcs->proto2); 352 dev_err(bcs->cs->dev, "%s: invalid L2 protocol: %u\n",
353 __func__, bcs->proto2);
348 return -EINVAL; 354 return -EINVAL;
349 } 355 }
350 356
@@ -372,7 +378,7 @@ int gigaset_isdn_setup_dial(struct at_state_t *at_state, void *data)
372 bcs->commands[i] = NULL; 378 bcs->commands[i] = NULL;
373 if (length[i] && 379 if (length[i] &&
374 !(bcs->commands[i] = kmalloc(length[i], GFP_ATOMIC))) { 380 !(bcs->commands[i] = kmalloc(length[i], GFP_ATOMIC))) {
375 err("out of memory"); 381 dev_err(bcs->cs->dev, "out of memory\n");
376 return -ENOMEM; 382 return -ENOMEM;
377 } 383 }
378 } 384 }
@@ -417,7 +423,8 @@ int gigaset_isdn_setup_accept(struct at_state_t *at_state)
417 proto = 2; /* 0: Bitsynchron, 1: HDLC, 2: voice */ 423 proto = 2; /* 0: Bitsynchron, 1: HDLC, 2: voice */
418 break; 424 break;
419 default: 425 default:
420 err("invalid protocol: %u", bcs->proto2); 426 dev_err(at_state->cs->dev, "%s: invalid protocol: %u\n",
427 __func__, bcs->proto2);
421 return -EINVAL; 428 return -EINVAL;
422 } 429 }
423 430
@@ -434,7 +441,7 @@ int gigaset_isdn_setup_accept(struct at_state_t *at_state)
434 bcs->commands[i] = NULL; 441 bcs->commands[i] = NULL;
435 if (length[i] && 442 if (length[i] &&
436 !(bcs->commands[i] = kmalloc(length[i], GFP_ATOMIC))) { 443 !(bcs->commands[i] = kmalloc(length[i], GFP_ATOMIC))) {
437 err("out of memory"); 444 dev_err(at_state->cs->dev, "out of memory\n");
438 return -ENOMEM; 445 return -ENOMEM;
439 } 446 }
440 } 447 }
@@ -473,7 +480,7 @@ int gigaset_isdn_icall(struct at_state_t *at_state)
473 response.parm.setup.si1 = 1; 480 response.parm.setup.si1 = 1;
474 response.parm.setup.si2 = 2; 481 response.parm.setup.si2 = 2;
475 } else { 482 } else {
476 warn("RING ignored - unsupported BC %s", 483 dev_warn(cs->dev, "RING ignored - unsupported BC %s\n",
477 at_state->str_var[STR_ZBC]); 484 at_state->str_var[STR_ZBC]);
478 return ICALL_IGNORE; 485 return ICALL_IGNORE;
479 } 486 }
@@ -491,18 +498,17 @@ int gigaset_isdn_icall(struct at_state_t *at_state)
491 response.parm.setup.eazmsn[0] = 0; 498 response.parm.setup.eazmsn[0] = 0;
492 499
493 if (!bcs) { 500 if (!bcs) {
494 notice("no channel for incoming call"); 501 dev_notice(cs->dev, "no channel for incoming call\n");
495 dbg(DEBUG_CMD, "Sending ICALLW");
496 response.command = ISDN_STAT_ICALLW; 502 response.command = ISDN_STAT_ICALLW;
497 response.arg = 0; //FIXME 503 response.arg = 0; //FIXME
498 } else { 504 } else {
499 dbg(DEBUG_CMD, "Sending ICALL"); 505 gig_dbg(DEBUG_CMD, "Sending ICALL");
500 response.command = ISDN_STAT_ICALL; 506 response.command = ISDN_STAT_ICALL;
501 response.arg = bcs->channel; //FIXME 507 response.arg = bcs->channel; //FIXME
502 } 508 }
503 response.driver = cs->myid; 509 response.driver = cs->myid;
504 retval = cs->iif.statcallb(&response); 510 retval = cs->iif.statcallb(&response);
505 dbg(DEBUG_CMD, "Response: %d", retval); 511 gig_dbg(DEBUG_CMD, "Response: %d", retval);
506 switch (retval) { 512 switch (retval) {
507 case 0: /* no takers */ 513 case 0: /* no takers */
508 return ICALL_IGNORE; 514 return ICALL_IGNORE;
@@ -512,7 +518,8 @@ int gigaset_isdn_icall(struct at_state_t *at_state)
512 case 2: /* reject */ 518 case 2: /* reject */
513 return ICALL_REJECT; 519 return ICALL_REJECT;
514 case 3: /* incomplete */ 520 case 3: /* incomplete */
515 warn("LL requested unsupported feature: Incomplete Number"); 521 dev_warn(cs->dev,
522 "LL requested unsupported feature: Incomplete Number\n");
516 return ICALL_IGNORE; 523 return ICALL_IGNORE;
517 case 4: /* proceeding */ 524 case 4: /* proceeding */
518 /* Gigaset will send ALERTING anyway. 525 /* Gigaset will send ALERTING anyway.
@@ -520,10 +527,11 @@ int gigaset_isdn_icall(struct at_state_t *at_state)
520 */ 527 */
521 return ICALL_ACCEPT; 528 return ICALL_ACCEPT;
522 case 5: /* deflect */ 529 case 5: /* deflect */
523 warn("LL requested unsupported feature: Call Deflection"); 530 dev_warn(cs->dev,
531 "LL requested unsupported feature: Call Deflection\n");
524 return ICALL_IGNORE; 532 return ICALL_IGNORE;
525 default: 533 default:
526 err("LL error %d on ICALL", retval); 534 dev_err(cs->dev, "LL error %d on ICALL\n", retval);
527 return ICALL_IGNORE; 535 return ICALL_IGNORE;
528 } 536 }
529} 537}
@@ -533,7 +541,7 @@ int gigaset_register_to_LL(struct cardstate *cs, const char *isdnid)
533{ 541{
534 isdn_if *iif = &cs->iif; 542 isdn_if *iif = &cs->iif;
535 543
536 dbg(DEBUG_ANY, "Register driver capabilities to LL"); 544 gig_dbg(DEBUG_ANY, "Register driver capabilities to LL");
537 545
538 //iif->id[sizeof(iif->id) - 1]=0; 546 //iif->id[sizeof(iif->id) - 1]=0;
539 //strncpy(iif->id, isdnid, sizeof(iif->id) - 1); 547 //strncpy(iif->id, isdnid, sizeof(iif->id) - 1);
@@ -551,17 +559,17 @@ int gigaset_register_to_LL(struct cardstate *cs, const char *isdnid)
551#endif 559#endif
552 ISDN_FEATURE_L3_TRANS | 560 ISDN_FEATURE_L3_TRANS |
553 ISDN_FEATURE_P_EURO; 561 ISDN_FEATURE_P_EURO;
554 iif->hl_hdrlen = HW_HDR_LEN; /* Area for storing ack */ 562 iif->hl_hdrlen = HW_HDR_LEN; /* Area for storing ack */
555 iif->command = command_from_LL; 563 iif->command = command_from_LL;
556 iif->writebuf_skb = writebuf_from_LL; 564 iif->writebuf_skb = writebuf_from_LL;
557 iif->writecmd = NULL; /* Don't support isdnctrl */ 565 iif->writecmd = NULL; /* Don't support isdnctrl */
558 iif->readstat = NULL; /* Don't support isdnctrl */ 566 iif->readstat = NULL; /* Don't support isdnctrl */
559 iif->rcvcallb_skb = NULL; /* Will be set by LL */ 567 iif->rcvcallb_skb = NULL; /* Will be set by LL */
560 iif->statcallb = NULL; /* Will be set by LL */ 568 iif->statcallb = NULL; /* Will be set by LL */
561 569
562 if (!register_isdn(iif)) 570 if (!register_isdn(iif))
563 return 0; 571 return 0;
564 572
565 cs->myid = iif->channels; /* Set my device id */ 573 cs->myid = iif->channels; /* Set my device id */
566 return 1; 574 return 1;
567} 575}