diff options
author | Tilman Schmidt <tilman@imap.cc> | 2010-07-05 10:18:48 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-07 19:57:52 -0400 |
commit | 2ed5e4ff272c0cb10a602ccb02f97c3b10801739 (patch) | |
tree | 172ee9e8d6597587f64fb0b95a4992a24dd919ff | |
parent | e3628dd176ba3ed329991ef042c29aae60617630 (diff) |
isdn/gigaset: ignore irrelevant device responses
Downgrade the Gigaset driver's reaction to unknown AT responses from
the device from warning to debug level, and remove the handling of
some device responses which aren't relevant for the driver's
operation.
Impact: cleanup
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/isdn/gigaset/ev-layer.c | 67 | ||||
-rw-r--r-- | drivers/isdn/gigaset/gigaset.h | 5 |
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 |