Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 170894
b: refs/heads/master
c: 50e4fe9
h: refs/heads/master
v: v3
  • Loading branch information
Tilman Schmidt authored and David S. Miller committed Oct 29, 2009
1 parent fdbfca3 commit 965713a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c35a87ff6678f92b12437843e88f9c89437ed4a7
refs/heads/master: 50e4fe91a5edbf680853b2ca37300a47ff860d63
42 changes: 25 additions & 17 deletions trunk/drivers/isdn/gigaset/ev-layer.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,11 @@ struct reply_t gigaset_tab_cid[] =
};


static const struct resp_type_t resp_type[] =
static const struct resp_type_t {
unsigned char *response;
int resp_code;
int type;
} resp_type[] =
{
{"OK", RSP_OK, RT_NOTHING},
{"ERROR", RSP_ERROR, RT_NOTHING},
Expand Down Expand Up @@ -402,6 +406,20 @@ static const struct resp_type_t resp_type[] =
{NULL, 0, 0}
};

static const struct zsau_resp_t {
unsigned char *str;
int code;
} zsau_resp[] =
{
{"OUTGOING_CALL_PROCEEDING", ZSAU_OUTGOING_CALL_PROCEEDING},
{"CALL_DELIVERED", ZSAU_CALL_DELIVERED},
{"ACTIVE", ZSAU_ACTIVE},
{"DISCONNECT_IND", ZSAU_DISCONNECT_IND},
{"NULL", ZSAU_NULL},
{"DISCONNECT_REQ", ZSAU_DISCONNECT_REQ},
{NULL, ZSAU_UNKNOWN}
};

/*
* Get integer from char-pointer
*/
Expand Down Expand Up @@ -480,6 +498,7 @@ void gigaset_handle_modem_response(struct cardstate *cs)
int params;
int i, j;
const struct resp_type_t *rt;
const struct zsau_resp_t *zr;
int curarg;
unsigned long flags;
unsigned next, tail, head;
Expand Down Expand Up @@ -606,25 +625,14 @@ void gigaset_handle_modem_response(struct cardstate *cs)
event->parameter = ZSAU_NONE;
break;
}
if (!strcmp(argv[curarg], "OUTGOING_CALL_PROCEEDING"))
event->parameter =
ZSAU_OUTGOING_CALL_PROCEEDING;
else if (!strcmp(argv[curarg], "CALL_DELIVERED"))
event->parameter = ZSAU_CALL_DELIVERED;
else if (!strcmp(argv[curarg], "ACTIVE"))
event->parameter = ZSAU_ACTIVE;
else if (!strcmp(argv[curarg], "DISCONNECT_IND"))
event->parameter = ZSAU_DISCONNECT_IND;
else if (!strcmp(argv[curarg], "NULL"))
event->parameter = ZSAU_NULL;
else if (!strcmp(argv[curarg], "DISCONNECT_REQ"))
event->parameter = ZSAU_DISCONNECT_REQ;
else {
event->parameter = ZSAU_UNKNOWN;
for (zr = zsau_resp; zr->str; ++zr)
if (!strcmp(argv[curarg], zr->str))
break;
event->parameter = zr->code;
if (!zr->str)
dev_warn(cs->dev,
"%s: unknown parameter %s after ZSAU\n",
__func__, argv[curarg]);
}
++curarg;
break;
case RT_STRING:
Expand Down
6 changes: 0 additions & 6 deletions trunk/drivers/isdn/gigaset/gigaset.h
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,6 @@ struct at_state_t {
struct bc_state *bcs;
};

struct resp_type_t {
unsigned char *response;
int resp_code; /* RSP_XXXX */
int type; /* RT_XXXX */
};

struct event_t {
int type;
void *ptr, *arg;
Expand Down

0 comments on commit 965713a

Please sign in to comment.