Initial revision
[linux-2.6.git] / drivers / isdn / gigaset / ev-layer.c
index 44f02db..18e05c0 100644 (file)
@@ -1262,8 +1262,7 @@ static void do_action(int action, struct cardstate *cs,
                break;
        case ACT_HUPMODEM:
                /* send "+++" (hangup in unimodem mode) */
-               if (cs->connected)
-                       cs->ops->write_cmd(cs, "+++", 3, NULL);
+               cs->ops->write_cmd(cs, "+++", 3, NULL);
                break;
        case ACT_RING:
                /* get fresh AT state structure for new CID */
@@ -1295,6 +1294,7 @@ static void do_action(int action, struct cardstate *cs,
                break;
        case ACT_ICALL:
                handle_icall(cs, bcs, p_at_state);
+               at_state = *p_at_state;
                break;
        case ACT_FAILSDOWN:
                dev_warn(cs->dev, "Could not shut down the device.\n");
@@ -1334,8 +1334,10 @@ static void do_action(int action, struct cardstate *cs,
                         */
                        at_state->pending_commands |= PC_DLE0;
                        atomic_set(&cs->commands_pending, 1);
-               } else
+               } else {
                        disconnect(p_at_state);
+                       at_state = *p_at_state;
+               }
                break;
        case ACT_FAKEDLE0:
                at_state->int_var[VAR_ZDLE] = 0;
@@ -1352,8 +1354,10 @@ static void do_action(int action, struct cardstate *cs,
                at_state->cid = -1;
                if (bcs && cs->onechannel)
                        at_state->pending_commands |= PC_DLE0;
-               else
+               else {
                        disconnect(p_at_state);
+                       at_state = *p_at_state;
+               }
                schedule_init(cs, MS_RECOVER);
                break;
        case ACT_FAILDLE0:
@@ -1406,6 +1410,7 @@ static void do_action(int action, struct cardstate *cs,
 
        case ACT_ABORTACCEPT:   /* hangup/error/timeout during ICALL processing */
                disconnect(p_at_state);
+               at_state = *p_at_state;
                break;
 
        case ACT_ABORTDIAL:     /* error/timeout during dial preparation */