aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn')
-rw-r--r--drivers/isdn/gigaset/ev-layer.c67
-rw-r--r--drivers/isdn/gigaset/gigaset.h5
2 files changed, 16 insertions, 56 deletions
diff --git a/drivers/isdn/gigaset/ev-layer.c b/drivers/isdn/gigaset/ev-layer.c
index 0d5984a86795..657757b72618 100644
--- a/drivers/isdn/gigaset/ev-layer.c
+++ b/drivers/isdn/gigaset/ev-layer.c
@@ -35,53 +35,40 @@
35#define RT_RING 2 35#define RT_RING 2
36#define RT_NUMBER 3 36#define RT_NUMBER 3
37#define RT_STRING 4 37#define RT_STRING 4
38#define RT_HEX 5
39#define RT_ZCAU 6 38#define RT_ZCAU 6
40 39
41/* Possible ASCII responses */ 40/* Possible ASCII responses */
42#define RSP_OK 0 41#define RSP_OK 0
43#define RSP_BUSY 1 42#define RSP_ERROR 1
44#define RSP_CONNECT 2
45#define RSP_ZGCI 3 43#define RSP_ZGCI 3
46#define RSP_RING 4 44#define RSP_RING 4
47#define RSP_ZAOC 5 45#define RSP_ZVLS 5
48#define RSP_ZCSTR 6 46#define RSP_ZCAU 6
49#define RSP_ZCFGT 7 47
50#define RSP_ZCFG 8 48/* responses with values to store in at_state */
51#define RSP_ZCCR 9 49/* - numeric */
52#define RSP_EMPTY 10
53#define RSP_ZLOG 11
54#define RSP_ZCAU 12
55#define RSP_ZMWI 13
56#define RSP_ZABINFO 14
57#define RSP_ZSMLSTCHG 15
58#define RSP_VAR 100 50#define RSP_VAR 100
59#define RSP_ZSAU (RSP_VAR + VAR_ZSAU) 51#define RSP_ZSAU (RSP_VAR + VAR_ZSAU)
60#define RSP_ZDLE (RSP_VAR + VAR_ZDLE) 52#define RSP_ZDLE (RSP_VAR + VAR_ZDLE)
61#define RSP_ZVLS (RSP_VAR + VAR_ZVLS)
62#define RSP_ZCTP (RSP_VAR + VAR_ZCTP) 53#define RSP_ZCTP (RSP_VAR + VAR_ZCTP)
54/* - string */
63#define RSP_STR (RSP_VAR + VAR_NUM) 55#define RSP_STR (RSP_VAR + VAR_NUM)
64#define RSP_NMBR (RSP_STR + STR_NMBR) 56#define RSP_NMBR (RSP_STR + STR_NMBR)
65#define RSP_ZCPN (RSP_STR + STR_ZCPN) 57#define RSP_ZCPN (RSP_STR + STR_ZCPN)
66#define RSP_ZCON (RSP_STR + STR_ZCON) 58#define RSP_ZCON (RSP_STR + STR_ZCON)
67#define RSP_ZBC (RSP_STR + STR_ZBC) 59#define RSP_ZBC (RSP_STR + STR_ZBC)
68#define RSP_ZHLC (RSP_STR + STR_ZHLC) 60#define RSP_ZHLC (RSP_STR + STR_ZHLC)
69#define RSP_ERROR -1 /* ERROR */ 61
70#define RSP_WRONG_CID -2 /* unknown cid in cmd */ 62#define RSP_WRONG_CID -2 /* unknown cid in cmd */
71#define RSP_UNKNOWN -4 /* unknown response */
72#define RSP_FAIL -5 /* internal error */
73#define RSP_INVAL -6 /* invalid response */ 63#define RSP_INVAL -6 /* invalid response */
64#define RSP_NODEV -9 /* device not connected */
74 65
75#define RSP_NONE -19 66#define RSP_NONE -19
76#define RSP_STRING -20 67#define RSP_STRING -20
77#define RSP_NULL -21 68#define RSP_NULL -21
78#define RSP_RETRYFAIL -22
79#define RSP_RETRY -23
80#define RSP_SKIP -24
81#define RSP_INIT -27 69#define RSP_INIT -27
82#define RSP_ANY -26 70#define RSP_ANY -26
83#define RSP_LAST -28 71#define RSP_LAST -28
84#define RSP_NODEV -9
85 72
86/* actions for process_response */ 73/* actions for process_response */
87#define ACT_NOTHING 0 74#define ACT_NOTHING 0
@@ -259,13 +246,6 @@ struct reply_t gigaset_tab_nocid[] =
259 246
260/* misc. */ 247/* misc. */
261{RSP_ERROR, -1, -1, -1, -1, -1, {ACT_ERROR} }, 248{RSP_ERROR, -1, -1, -1, -1, -1, {ACT_ERROR} },
262{RSP_ZCFGT, -1, -1, -1, -1, -1, {ACT_DEBUG} },
263{RSP_ZCFG, -1, -1, -1, -1, -1, {ACT_DEBUG} },
264{RSP_ZLOG, -1, -1, -1, -1, -1, {ACT_DEBUG} },
265{RSP_ZMWI, -1, -1, -1, -1, -1, {ACT_DEBUG} },
266{RSP_ZABINFO, -1, -1, -1, -1, -1, {ACT_DEBUG} },
267{RSP_ZSMLSTCHG, -1, -1, -1, -1, -1, {ACT_DEBUG} },
268
269{RSP_ZCAU, -1, -1, -1, -1, -1, {ACT_ZCAU} }, 249{RSP_ZCAU, -1, -1, -1, -1, -1, {ACT_ZCAU} },
270{RSP_NONE, -1, -1, -1, -1, -1, {ACT_DEBUG} }, 250{RSP_NONE, -1, -1, -1, -1, -1, {ACT_DEBUG} },
271{RSP_ANY, -1, -1, -1, -1, -1, {ACT_WARN} }, 251{RSP_ANY, -1, -1, -1, -1, -1, {ACT_WARN} },
@@ -361,10 +341,6 @@ struct reply_t gigaset_tab_cid[] =
361 341
362/* misc. */ 342/* misc. */
363{RSP_ZCON, -1, -1, -1, -1, -1, {ACT_DEBUG} }, 343{RSP_ZCON, -1, -1, -1, -1, -1, {ACT_DEBUG} },
364{RSP_ZCCR, -1, -1, -1, -1, -1, {ACT_DEBUG} },
365{RSP_ZAOC, -1, -1, -1, -1, -1, {ACT_DEBUG} },
366{RSP_ZCSTR, -1, -1, -1, -1, -1, {ACT_DEBUG} },
367
368{RSP_ZCAU, -1, -1, -1, -1, -1, {ACT_ZCAU} }, 344{RSP_ZCAU, -1, -1, -1, -1, -1, {ACT_ZCAU} },
369{RSP_NONE, -1, -1, -1, -1, -1, {ACT_DEBUG} }, 345{RSP_NONE, -1, -1, -1, -1, -1, {ACT_DEBUG} },
370{RSP_ANY, -1, -1, -1, -1, -1, {ACT_WARN} }, 346{RSP_ANY, -1, -1, -1, -1, -1, {ACT_WARN} },
@@ -387,20 +363,11 @@ static const struct resp_type_t {
387 {"ZVLS", RSP_ZVLS, RT_NUMBER}, 363 {"ZVLS", RSP_ZVLS, RT_NUMBER},
388 {"ZCTP", RSP_ZCTP, RT_NUMBER}, 364 {"ZCTP", RSP_ZCTP, RT_NUMBER},
389 {"ZDLE", RSP_ZDLE, RT_NUMBER}, 365 {"ZDLE", RSP_ZDLE, RT_NUMBER},
390 {"ZCFGT", RSP_ZCFGT, RT_NUMBER},
391 {"ZCCR", RSP_ZCCR, RT_NUMBER},
392 {"ZMWI", RSP_ZMWI, RT_NUMBER},
393 {"ZHLC", RSP_ZHLC, RT_STRING}, 366 {"ZHLC", RSP_ZHLC, RT_STRING},
394 {"ZBC", RSP_ZBC, RT_STRING}, 367 {"ZBC", RSP_ZBC, RT_STRING},
395 {"NMBR", RSP_NMBR, RT_STRING}, 368 {"NMBR", RSP_NMBR, RT_STRING},
396 {"ZCPN", RSP_ZCPN, RT_STRING}, 369 {"ZCPN", RSP_ZCPN, RT_STRING},
397 {"ZCON", RSP_ZCON, RT_STRING}, 370 {"ZCON", RSP_ZCON, RT_STRING},
398 {"ZAOC", RSP_ZAOC, RT_STRING},
399 {"ZCSTR", RSP_ZCSTR, RT_STRING},
400 {"ZCFG", RSP_ZCFG, RT_HEX},
401 {"ZLOG", RSP_ZLOG, RT_NOTHING},
402 {"ZABINFO", RSP_ZABINFO, RT_NOTHING},
403 {"ZSMLSTCHG", RSP_ZSMLSTCHG, RT_NOTHING},
404 {NULL, 0, 0} 371 {NULL, 0, 0}
405}; 372};
406 373
@@ -588,10 +555,10 @@ void gigaset_handle_modem_response(struct cardstate *cs)
588 break; 555 break;
589 556
590 if (!rt->response) { 557 if (!rt->response) {
591 event->type = RSP_UNKNOWN; 558 event->type = RSP_NONE;
592 dev_warn(cs->dev, 559 gig_dbg(DEBUG_EVENT,
593 "unknown modem response: %s\n", 560 "unknown modem response: '%s'\n",
594 argv[curarg]); 561 argv[curarg]);
595 break; 562 break;
596 } 563 }
597 564
@@ -655,14 +622,8 @@ void gigaset_handle_modem_response(struct cardstate *cs)
655 curarg = params - 1; 622 curarg = params - 1;
656 break; 623 break;
657 case RT_NUMBER: 624 case RT_NUMBER:
658 case RT_HEX:
659 if (curarg < params) { 625 if (curarg < params) {
660 if (param_type == RT_HEX) 626 event->parameter = isdn_getnum(argv[curarg]);
661 event->parameter =
662 isdn_gethex(argv[curarg]);
663 else
664 event->parameter =
665 isdn_getnum(argv[curarg]);
666 ++curarg; 627 ++curarg;
667 } else 628 } else
668 event->parameter = -1; 629 event->parameter = -1;
diff --git a/drivers/isdn/gigaset/gigaset.h b/drivers/isdn/gigaset/gigaset.h
index 904c9473effc..ba9547ba34b5 100644
--- a/drivers/isdn/gigaset/gigaset.h
+++ b/drivers/isdn/gigaset/gigaset.h
@@ -193,9 +193,8 @@ void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg,
193/* variables in struct at_state_t */ 193/* variables in struct at_state_t */
194#define VAR_ZSAU 0 194#define VAR_ZSAU 0
195#define VAR_ZDLE 1 195#define VAR_ZDLE 1
196#define VAR_ZVLS 2 196#define VAR_ZCTP 2
197#define VAR_ZCTP 3 197#define VAR_NUM 3
198#define VAR_NUM 4
199 198
200#define STR_NMBR 0 199#define STR_NMBR 0
201#define STR_ZCPN 1 200#define STR_ZCPN 1