Lines Matching refs:at_state
48 /* responses with values to store in at_state */
441 if (cs->at_state.getstring) {
443 cs->at_state.getstring = 0;
465 gigaset_add_event(cs, &cs->at_state, RSP_INVAL,
497 event->at_state = NULL;
625 cs->at_state.pending_commands |= PC_UMMODE;
668 ret = &cs->bcs[i].at_state;
686 struct at_state_t *at_state;
688 cs->at_state.pending_commands &= ~PC_INIT;
693 at_state = &cs->bcs[i].at_state;
694 if (at_state->pending_commands & PC_CID) {
695 at_state->pending_commands &= ~PC_CID;
696 at_state->pending_commands |= PC_NOCID;
704 if (cs->at_state.pending_commands & PC_INIT) {
711 cs->at_state.pending_commands |= PC_INIT;
746 struct at_state_t *at_state;
751 return &cs->at_state;
754 if (cid == cs->bcs[i].at_state.cid)
755 return &cs->bcs[i].at_state;
759 list_for_each_entry(at_state, &cs->temp_at_states, list)
760 if (cid == at_state->cid) {
762 return at_state;
799 static void start_dial(struct at_state_t *at_state, void *data,
802 struct bc_state *bcs = at_state->bcs;
803 struct cardstate *cs = at_state->cs;
811 if (at_state->seq_index != seq_index) {
822 at_state->pending_commands |= PC_CID;
832 at_state->pending_commands |= PC_NOCID;
838 static void start_accept(struct at_state_t *at_state)
840 struct cardstate *cs = at_state->cs;
841 struct bc_state *bcs = at_state->bcs;
852 dev_err(at_state->cs->dev, "out of memory\n");
854 at_state->pending_commands |= PC_HUP;
863 at_state->pending_commands |= PC_ACCEPT;
908 cs->at_state.pending_commands |= PC_SHUTDOWN;
942 if (cs->bcs[i].at_state.cid > 0)
951 cs->bcs[channel].at_state.pending_commands |= PC_CID;
962 struct at_state_t *at_state;
967 if (test_ptr == &cs->at_state)
970 list_for_each_entry(at_state, &cs->temp_at_states, list)
971 if (at_state == test_ptr)
975 if (&cs->bcs[channel].at_state == test_ptr)
988 struct at_state_t *at_state = *p_at_state;
990 retval = gigaset_isdn_icall(at_state);
1003 at_state->pending_commands |= PC_HUP;
1018 cs->at_state.pending_commands)
1022 if (cs->bcs[i].at_state.pending_commands)
1062 struct at_state_t *at_state = *p_at_state;
1076 at_state->waiting = 1;
1079 cs->at_state.pending_commands &= ~PC_INIT;
1090 cs->at_state.pending_commands |= PC_CIDMODE;
1197 at_state->pending_commands |= PC_DLE1;
1214 at_state->int_var[VAR_ZSAU] = ZSAU_NULL;
1218 at_state->cid = -1;
1223 at_state->pending_commands |= PC_DLE0;
1229 at_state->int_var[VAR_ZDLE] = 0;
1234 at_state2 = &cs->bcs[cs->curchannel].at_state;
1240 at_state->cid = -1;
1242 at_state->pending_commands |= PC_DLE0;
1250 at_state2 = &cs->bcs[cs->curchannel].at_state;
1259 cs->bcs[channel].at_state.pending_commands |= PC_HUP;
1267 cs->bcs[channel].at_state.cid = ev->parameter;
1268 cs->bcs[channel].at_state.pending_commands |=
1280 at_state2 = &cs->bcs[channel].at_state;
1286 at_state2 = &cs->bcs[cs->curchannel].at_state;
1301 at_state->pending_commands |= PC_HUP;
1308 at_state->pending_commands |= PC_HUP;
1313 at_state->getstring = 1;
1347 /*at_state->getstring = 1;*/
1366 __func__, at_state->ConState);
1371 __func__, ev->type, at_state->ConState);
1375 __func__, ev->type, at_state->ConState);
1379 ev->parameter, at_state->ConState);
1384 start_dial(at_state, ev->ptr, ev->parameter);
1387 start_accept(at_state);
1390 at_state->pending_commands |= PC_HUP;
1428 cs->at_state.pending_commands |= PC_CIDMODE;
1431 cs->at_state.pending_commands |= PC_UMMODE;
1455 *pp_command = at_state->bcs->commands[action - ACT_CMD];
1475 struct at_state_t *at_state;
1481 at_state = at_state_from_cid(cs, ev->cid);
1482 if (!at_state) {
1485 gigaset_add_event(cs, &cs->at_state, RSP_WRONG_CID,
1490 at_state = ev->at_state;
1491 if (at_state_invalid(cs, at_state)) {
1492 gig_dbg(DEBUG_EVENT, "event for invalid at_state %p",
1493 at_state);
1499 at_state->ConState, ev->type);
1501 bcs = at_state->bcs;
1502 sendcid = at_state->cid;
1505 rep = at_state->replystruct;
1509 if (ev->parameter != at_state->timer_index
1510 || !at_state->timer_active) {
1513 } else if (!at_state->waiting)
1520 /* if the response belongs to a variable in at_state->int_var[VAR_XXXX]
1521 or at_state->str_var[STR_XXXX], set it */
1524 at_state->int_var[index] = ev->parameter;
1527 kfree(at_state->str_var[index]);
1528 at_state->str_var[index] = ev->ptr;
1534 at_state->getstring = 0;
1544 __func__, ev->type, at_state->ConState);
1548 && ((int) at_state->ConState >= rep->min_ConState)
1550 || (int) at_state->ConState <= rep->max_ConState)
1557 at_state->waiting = 0;
1561 do_action(rep->action[curact], cs, bcs, &at_state, &p_command,
1563 if (!at_state)
1567 if (at_state) {
1570 at_state->ConState = rep->new_ConState;
1574 at_state->timer_expires = 0;
1575 at_state->timer_active = 0;
1577 gigaset_add_event(cs, at_state, resp_code,
1587 gigaset_add_event(cs, at_state,
1594 at_state->timer_expires = 0;
1595 at_state->timer_active = 0;
1597 at_state->timer_expires = rep->timeout * 10;
1598 at_state->timer_active = 1;
1599 ++at_state->timer_index;
1607 struct at_state_t *at_state, int sequence)
1610 gigaset_add_event(cs, at_state, RSP_INIT, NULL, sequence, NULL);
1615 struct at_state_t *at_state = NULL;
1633 if (cs->at_state.pending_commands & PC_SHUTDOWN) {
1634 cs->at_state.pending_commands &= ~PC_CIDMODE;
1637 at_state = &bcs->at_state;
1638 at_state->pending_commands &=
1640 if (at_state->cid > 0)
1641 at_state->pending_commands |= PC_HUP;
1642 if (at_state->pending_commands & PC_CID) {
1643 at_state->pending_commands |= PC_NOCID;
1644 at_state->pending_commands &= ~PC_CID;
1650 if (cs->at_state.pending_commands & PC_INIT) {
1651 cs->at_state.pending_commands &= ~PC_CIDMODE;
1654 at_state = &bcs->at_state;
1655 at_state->pending_commands &=
1657 if (at_state->cid > 0)
1658 at_state->pending_commands |= PC_HUP;
1660 if (at_state->pending_commands & PC_CID) {
1661 at_state->pending_commands |= PC_NOCID;
1662 at_state->pending_commands &= ~PC_CID;
1671 if (cs->at_state.pending_commands == PC_UMMODE
1676 at_state = &cs->at_state;
1679 if (bcs->at_state.pending_commands ||
1680 bcs->at_state.cid > 0) {
1687 cs->at_state.pending_commands &= ~PC_UMMODE;
1689 schedule_sequence(cs, at_state, sequence);
1695 if (bcs->at_state.pending_commands & PC_HUP) {
1696 bcs->at_state.pending_commands &= ~PC_HUP;
1697 if (bcs->at_state.pending_commands & PC_CID) {
1699 bcs->at_state.pending_commands |= PC_NOCID;
1700 bcs->at_state.pending_commands &= ~PC_CID;
1702 schedule_sequence(cs, &bcs->at_state, SEQ_HUP);
1706 if (bcs->at_state.pending_commands & PC_NOCID) {
1707 bcs->at_state.pending_commands &= ~PC_NOCID;
1709 schedule_sequence(cs, &cs->at_state, SEQ_NOCID);
1711 } else if (bcs->at_state.pending_commands & PC_DLE0) {
1712 bcs->at_state.pending_commands &= ~PC_DLE0;
1714 schedule_sequence(cs, &cs->at_state, SEQ_DLE0);
1719 list_for_each_entry(at_state, &cs->temp_at_states, list)
1720 if (at_state->pending_commands & PC_HUP) {
1721 at_state->pending_commands &= ~PC_HUP;
1722 schedule_sequence(cs, at_state, SEQ_HUP);
1726 if (cs->at_state.pending_commands & PC_INIT) {
1727 cs->at_state.pending_commands &= ~PC_INIT;
1730 schedule_sequence(cs, &cs->at_state, SEQ_INIT);
1733 if (cs->at_state.pending_commands & PC_SHUTDOWN) {
1734 cs->at_state.pending_commands &= ~PC_SHUTDOWN;
1735 schedule_sequence(cs, &cs->at_state, SEQ_SHUTDOWN);
1738 if (cs->at_state.pending_commands & PC_CIDMODE) {
1739 cs->at_state.pending_commands &= ~PC_CIDMODE;
1742 schedule_sequence(cs, &cs->at_state, SEQ_CIDMODE);
1749 if (bcs->at_state.pending_commands & PC_DLE1) {
1750 bcs->at_state.pending_commands &= ~PC_DLE1;
1752 schedule_sequence(cs, &cs->at_state, SEQ_DLE1);
1755 if (bcs->at_state.pending_commands & PC_ACCEPT) {
1756 bcs->at_state.pending_commands &= ~PC_ACCEPT;
1757 schedule_sequence(cs, &bcs->at_state, SEQ_ACCEPT);
1760 if (bcs->at_state.pending_commands & PC_DIAL) {
1761 bcs->at_state.pending_commands &= ~PC_DIAL;
1762 schedule_sequence(cs, &bcs->at_state, SEQ_DIAL);
1765 if (bcs->at_state.pending_commands & PC_CID) {
1768 cs->at_state.pending_commands |= PC_CIDMODE;
1776 bcs->at_state.pending_commands &= ~PC_CID;
1779 schedule_sequence(cs, &cs->at_state, SEQ_CID);