diff options
Diffstat (limited to 'drivers/isdn/gigaset/ev-layer.c')
-rw-r--r-- | drivers/isdn/gigaset/ev-layer.c | 106 |
1 files changed, 52 insertions, 54 deletions
diff --git a/drivers/isdn/gigaset/ev-layer.c b/drivers/isdn/gigaset/ev-layer.c index cec1ef342fcc..5cbf64d850ee 100644 --- a/drivers/isdn/gigaset/ev-layer.c +++ b/drivers/isdn/gigaset/ev-layer.c | |||
@@ -735,7 +735,7 @@ static void disconnect(struct at_state_t **at_state_p) | |||
735 | /* revert to selected idle mode */ | 735 | /* revert to selected idle mode */ |
736 | if (!cs->cidmode) { | 736 | if (!cs->cidmode) { |
737 | cs->at_state.pending_commands |= PC_UMMODE; | 737 | cs->at_state.pending_commands |= PC_UMMODE; |
738 | atomic_set(&cs->commands_pending, 1); //FIXME | 738 | cs->commands_pending = 1; |
739 | gig_dbg(DEBUG_CMD, "Scheduling PC_UMMODE"); | 739 | gig_dbg(DEBUG_CMD, "Scheduling PC_UMMODE"); |
740 | } | 740 | } |
741 | spin_unlock_irqrestore(&cs->lock, flags); | 741 | spin_unlock_irqrestore(&cs->lock, flags); |
@@ -793,15 +793,15 @@ static void init_failed(struct cardstate *cs, int mode) | |||
793 | struct at_state_t *at_state; | 793 | struct at_state_t *at_state; |
794 | 794 | ||
795 | cs->at_state.pending_commands &= ~PC_INIT; | 795 | cs->at_state.pending_commands &= ~PC_INIT; |
796 | atomic_set(&cs->mode, mode); | 796 | cs->mode = mode; |
797 | atomic_set(&cs->mstate, MS_UNINITIALIZED); | 797 | cs->mstate = MS_UNINITIALIZED; |
798 | gigaset_free_channels(cs); | 798 | gigaset_free_channels(cs); |
799 | for (i = 0; i < cs->channels; ++i) { | 799 | for (i = 0; i < cs->channels; ++i) { |
800 | at_state = &cs->bcs[i].at_state; | 800 | at_state = &cs->bcs[i].at_state; |
801 | if (at_state->pending_commands & PC_CID) { | 801 | if (at_state->pending_commands & PC_CID) { |
802 | at_state->pending_commands &= ~PC_CID; | 802 | at_state->pending_commands &= ~PC_CID; |
803 | at_state->pending_commands |= PC_NOCID; | 803 | at_state->pending_commands |= PC_NOCID; |
804 | atomic_set(&cs->commands_pending, 1); | 804 | cs->commands_pending = 1; |
805 | } | 805 | } |
806 | } | 806 | } |
807 | } | 807 | } |
@@ -812,11 +812,11 @@ static void schedule_init(struct cardstate *cs, int state) | |||
812 | gig_dbg(DEBUG_CMD, "not scheduling PC_INIT again"); | 812 | gig_dbg(DEBUG_CMD, "not scheduling PC_INIT again"); |
813 | return; | 813 | return; |
814 | } | 814 | } |
815 | atomic_set(&cs->mstate, state); | 815 | cs->mstate = state; |
816 | atomic_set(&cs->mode, M_UNKNOWN); | 816 | cs->mode = M_UNKNOWN; |
817 | gigaset_block_channels(cs); | 817 | gigaset_block_channels(cs); |
818 | cs->at_state.pending_commands |= PC_INIT; | 818 | cs->at_state.pending_commands |= PC_INIT; |
819 | atomic_set(&cs->commands_pending, 1); | 819 | cs->commands_pending = 1; |
820 | gig_dbg(DEBUG_CMD, "Scheduling PC_INIT"); | 820 | gig_dbg(DEBUG_CMD, "Scheduling PC_INIT"); |
821 | } | 821 | } |
822 | 822 | ||
@@ -953,13 +953,13 @@ static void start_dial(struct at_state_t *at_state, void *data, unsigned seq_ind | |||
953 | 953 | ||
954 | at_state->pending_commands |= PC_CID; | 954 | at_state->pending_commands |= PC_CID; |
955 | gig_dbg(DEBUG_CMD, "Scheduling PC_CID"); | 955 | gig_dbg(DEBUG_CMD, "Scheduling PC_CID"); |
956 | atomic_set(&cs->commands_pending, 1); | 956 | cs->commands_pending = 1; |
957 | return; | 957 | return; |
958 | 958 | ||
959 | error: | 959 | error: |
960 | at_state->pending_commands |= PC_NOCID; | 960 | at_state->pending_commands |= PC_NOCID; |
961 | gig_dbg(DEBUG_CMD, "Scheduling PC_NOCID"); | 961 | gig_dbg(DEBUG_CMD, "Scheduling PC_NOCID"); |
962 | atomic_set(&cs->commands_pending, 1); | 962 | cs->commands_pending = 1; |
963 | return; | 963 | return; |
964 | } | 964 | } |
965 | 965 | ||
@@ -973,12 +973,12 @@ static void start_accept(struct at_state_t *at_state) | |||
973 | if (retval == 0) { | 973 | if (retval == 0) { |
974 | at_state->pending_commands |= PC_ACCEPT; | 974 | at_state->pending_commands |= PC_ACCEPT; |
975 | gig_dbg(DEBUG_CMD, "Scheduling PC_ACCEPT"); | 975 | gig_dbg(DEBUG_CMD, "Scheduling PC_ACCEPT"); |
976 | atomic_set(&cs->commands_pending, 1); | 976 | cs->commands_pending = 1; |
977 | } else { | 977 | } else { |
978 | //FIXME | 978 | /* error reset */ |
979 | at_state->pending_commands |= PC_HUP; | 979 | at_state->pending_commands |= PC_HUP; |
980 | gig_dbg(DEBUG_CMD, "Scheduling PC_HUP"); | 980 | gig_dbg(DEBUG_CMD, "Scheduling PC_HUP"); |
981 | atomic_set(&cs->commands_pending, 1); | 981 | cs->commands_pending = 1; |
982 | } | 982 | } |
983 | } | 983 | } |
984 | 984 | ||
@@ -986,7 +986,7 @@ static void do_start(struct cardstate *cs) | |||
986 | { | 986 | { |
987 | gigaset_free_channels(cs); | 987 | gigaset_free_channels(cs); |
988 | 988 | ||
989 | if (atomic_read(&cs->mstate) != MS_LOCKED) | 989 | if (cs->mstate != MS_LOCKED) |
990 | schedule_init(cs, MS_INIT); | 990 | schedule_init(cs, MS_INIT); |
991 | 991 | ||
992 | cs->isdn_up = 1; | 992 | cs->isdn_up = 1; |
@@ -1000,9 +1000,9 @@ static void do_start(struct cardstate *cs) | |||
1000 | 1000 | ||
1001 | static void finish_shutdown(struct cardstate *cs) | 1001 | static void finish_shutdown(struct cardstate *cs) |
1002 | { | 1002 | { |
1003 | if (atomic_read(&cs->mstate) != MS_LOCKED) { | 1003 | if (cs->mstate != MS_LOCKED) { |
1004 | atomic_set(&cs->mstate, MS_UNINITIALIZED); | 1004 | cs->mstate = MS_UNINITIALIZED; |
1005 | atomic_set(&cs->mode, M_UNKNOWN); | 1005 | cs->mode = M_UNKNOWN; |
1006 | } | 1006 | } |
1007 | 1007 | ||
1008 | /* Tell the LL that the device is not available .. */ | 1008 | /* Tell the LL that the device is not available .. */ |
@@ -1022,10 +1022,10 @@ static void do_shutdown(struct cardstate *cs) | |||
1022 | { | 1022 | { |
1023 | gigaset_block_channels(cs); | 1023 | gigaset_block_channels(cs); |
1024 | 1024 | ||
1025 | if (atomic_read(&cs->mstate) == MS_READY) { | 1025 | if (cs->mstate == MS_READY) { |
1026 | atomic_set(&cs->mstate, MS_SHUTDOWN); | 1026 | cs->mstate = MS_SHUTDOWN; |
1027 | cs->at_state.pending_commands |= PC_SHUTDOWN; | 1027 | cs->at_state.pending_commands |= PC_SHUTDOWN; |
1028 | atomic_set(&cs->commands_pending, 1); | 1028 | cs->commands_pending = 1; |
1029 | gig_dbg(DEBUG_CMD, "Scheduling PC_SHUTDOWN"); | 1029 | gig_dbg(DEBUG_CMD, "Scheduling PC_SHUTDOWN"); |
1030 | } else | 1030 | } else |
1031 | finish_shutdown(cs); | 1031 | finish_shutdown(cs); |
@@ -1120,7 +1120,7 @@ static void handle_icall(struct cardstate *cs, struct bc_state *bcs, | |||
1120 | * In fact it doesn't. | 1120 | * In fact it doesn't. |
1121 | */ | 1121 | */ |
1122 | at_state->pending_commands |= PC_HUP; | 1122 | at_state->pending_commands |= PC_HUP; |
1123 | atomic_set(&cs->commands_pending, 1); | 1123 | cs->commands_pending = 1; |
1124 | break; | 1124 | break; |
1125 | } | 1125 | } |
1126 | } | 1126 | } |
@@ -1130,7 +1130,7 @@ static int do_lock(struct cardstate *cs) | |||
1130 | int mode; | 1130 | int mode; |
1131 | int i; | 1131 | int i; |
1132 | 1132 | ||
1133 | switch (atomic_read(&cs->mstate)) { | 1133 | switch (cs->mstate) { |
1134 | case MS_UNINITIALIZED: | 1134 | case MS_UNINITIALIZED: |
1135 | case MS_READY: | 1135 | case MS_READY: |
1136 | if (cs->cur_at_seq || !list_empty(&cs->temp_at_states) || | 1136 | if (cs->cur_at_seq || !list_empty(&cs->temp_at_states) || |
@@ -1152,20 +1152,20 @@ static int do_lock(struct cardstate *cs) | |||
1152 | return -EBUSY; | 1152 | return -EBUSY; |
1153 | } | 1153 | } |
1154 | 1154 | ||
1155 | mode = atomic_read(&cs->mode); | 1155 | mode = cs->mode; |
1156 | atomic_set(&cs->mstate, MS_LOCKED); | 1156 | cs->mstate = MS_LOCKED; |
1157 | atomic_set(&cs->mode, M_UNKNOWN); | 1157 | cs->mode = M_UNKNOWN; |
1158 | 1158 | ||
1159 | return mode; | 1159 | return mode; |
1160 | } | 1160 | } |
1161 | 1161 | ||
1162 | static int do_unlock(struct cardstate *cs) | 1162 | static int do_unlock(struct cardstate *cs) |
1163 | { | 1163 | { |
1164 | if (atomic_read(&cs->mstate) != MS_LOCKED) | 1164 | if (cs->mstate != MS_LOCKED) |
1165 | return -EINVAL; | 1165 | return -EINVAL; |
1166 | 1166 | ||
1167 | atomic_set(&cs->mstate, MS_UNINITIALIZED); | 1167 | cs->mstate = MS_UNINITIALIZED; |
1168 | atomic_set(&cs->mode, M_UNKNOWN); | 1168 | cs->mode = M_UNKNOWN; |
1169 | gigaset_free_channels(cs); | 1169 | gigaset_free_channels(cs); |
1170 | if (cs->connected) | 1170 | if (cs->connected) |
1171 | schedule_init(cs, MS_INIT); | 1171 | schedule_init(cs, MS_INIT); |
@@ -1198,17 +1198,17 @@ static void do_action(int action, struct cardstate *cs, | |||
1198 | case ACT_INIT: | 1198 | case ACT_INIT: |
1199 | cs->at_state.pending_commands &= ~PC_INIT; | 1199 | cs->at_state.pending_commands &= ~PC_INIT; |
1200 | cs->cur_at_seq = SEQ_NONE; | 1200 | cs->cur_at_seq = SEQ_NONE; |
1201 | atomic_set(&cs->mode, M_UNIMODEM); | 1201 | cs->mode = M_UNIMODEM; |
1202 | spin_lock_irqsave(&cs->lock, flags); | 1202 | spin_lock_irqsave(&cs->lock, flags); |
1203 | if (!cs->cidmode) { | 1203 | if (!cs->cidmode) { |
1204 | spin_unlock_irqrestore(&cs->lock, flags); | 1204 | spin_unlock_irqrestore(&cs->lock, flags); |
1205 | gigaset_free_channels(cs); | 1205 | gigaset_free_channels(cs); |
1206 | atomic_set(&cs->mstate, MS_READY); | 1206 | cs->mstate = MS_READY; |
1207 | break; | 1207 | break; |
1208 | } | 1208 | } |
1209 | spin_unlock_irqrestore(&cs->lock, flags); | 1209 | spin_unlock_irqrestore(&cs->lock, flags); |
1210 | cs->at_state.pending_commands |= PC_CIDMODE; | 1210 | cs->at_state.pending_commands |= PC_CIDMODE; |
1211 | atomic_set(&cs->commands_pending, 1); | 1211 | cs->commands_pending = 1; |
1212 | gig_dbg(DEBUG_CMD, "Scheduling PC_CIDMODE"); | 1212 | gig_dbg(DEBUG_CMD, "Scheduling PC_CIDMODE"); |
1213 | break; | 1213 | break; |
1214 | case ACT_FAILINIT: | 1214 | case ACT_FAILINIT: |
@@ -1234,22 +1234,20 @@ static void do_action(int action, struct cardstate *cs, | |||
1234 | | INS_command; | 1234 | | INS_command; |
1235 | break; | 1235 | break; |
1236 | case ACT_CMODESET: | 1236 | case ACT_CMODESET: |
1237 | if (atomic_read(&cs->mstate) == MS_INIT || | 1237 | if (cs->mstate == MS_INIT || cs->mstate == MS_RECOVER) { |
1238 | atomic_read(&cs->mstate) == MS_RECOVER) { | ||
1239 | gigaset_free_channels(cs); | 1238 | gigaset_free_channels(cs); |
1240 | atomic_set(&cs->mstate, MS_READY); | 1239 | cs->mstate = MS_READY; |
1241 | } | 1240 | } |
1242 | atomic_set(&cs->mode, M_CID); | 1241 | cs->mode = M_CID; |
1243 | cs->cur_at_seq = SEQ_NONE; | 1242 | cs->cur_at_seq = SEQ_NONE; |
1244 | break; | 1243 | break; |
1245 | case ACT_UMODESET: | 1244 | case ACT_UMODESET: |
1246 | atomic_set(&cs->mode, M_UNIMODEM); | 1245 | cs->mode = M_UNIMODEM; |
1247 | cs->cur_at_seq = SEQ_NONE; | 1246 | cs->cur_at_seq = SEQ_NONE; |
1248 | break; | 1247 | break; |
1249 | case ACT_FAILCMODE: | 1248 | case ACT_FAILCMODE: |
1250 | cs->cur_at_seq = SEQ_NONE; | 1249 | cs->cur_at_seq = SEQ_NONE; |
1251 | if (atomic_read(&cs->mstate) == MS_INIT || | 1250 | if (cs->mstate == MS_INIT || cs->mstate == MS_RECOVER) { |
1252 | atomic_read(&cs->mstate) == MS_RECOVER) { | ||
1253 | init_failed(cs, M_UNKNOWN); | 1251 | init_failed(cs, M_UNKNOWN); |
1254 | break; | 1252 | break; |
1255 | } | 1253 | } |
@@ -1307,7 +1305,7 @@ static void do_action(int action, struct cardstate *cs, | |||
1307 | case ACT_CONNECT: | 1305 | case ACT_CONNECT: |
1308 | if (cs->onechannel) { | 1306 | if (cs->onechannel) { |
1309 | at_state->pending_commands |= PC_DLE1; | 1307 | at_state->pending_commands |= PC_DLE1; |
1310 | atomic_set(&cs->commands_pending, 1); | 1308 | cs->commands_pending = 1; |
1311 | break; | 1309 | break; |
1312 | } | 1310 | } |
1313 | bcs->chstate |= CHS_D_UP; | 1311 | bcs->chstate |= CHS_D_UP; |
@@ -1333,7 +1331,7 @@ static void do_action(int action, struct cardstate *cs, | |||
1333 | * DLE only used for M10x with one B channel. | 1331 | * DLE only used for M10x with one B channel. |
1334 | */ | 1332 | */ |
1335 | at_state->pending_commands |= PC_DLE0; | 1333 | at_state->pending_commands |= PC_DLE0; |
1336 | atomic_set(&cs->commands_pending, 1); | 1334 | cs->commands_pending = 1; |
1337 | } else | 1335 | } else |
1338 | disconnect(p_at_state); | 1336 | disconnect(p_at_state); |
1339 | break; | 1337 | break; |
@@ -1369,7 +1367,7 @@ static void do_action(int action, struct cardstate *cs, | |||
1369 | "Could not enter DLE mode. Trying to hang up.\n"); | 1367 | "Could not enter DLE mode. Trying to hang up.\n"); |
1370 | channel = cs->curchannel; | 1368 | channel = cs->curchannel; |
1371 | cs->bcs[channel].at_state.pending_commands |= PC_HUP; | 1369 | cs->bcs[channel].at_state.pending_commands |= PC_HUP; |
1372 | atomic_set(&cs->commands_pending, 1); | 1370 | cs->commands_pending = 1; |
1373 | break; | 1371 | break; |
1374 | 1372 | ||
1375 | case ACT_CID: /* got cid; start dialing */ | 1373 | case ACT_CID: /* got cid; start dialing */ |
@@ -1379,7 +1377,7 @@ static void do_action(int action, struct cardstate *cs, | |||
1379 | cs->bcs[channel].at_state.cid = ev->parameter; | 1377 | cs->bcs[channel].at_state.cid = ev->parameter; |
1380 | cs->bcs[channel].at_state.pending_commands |= | 1378 | cs->bcs[channel].at_state.pending_commands |= |
1381 | PC_DIAL; | 1379 | PC_DIAL; |
1382 | atomic_set(&cs->commands_pending, 1); | 1380 | cs->commands_pending = 1; |
1383 | break; | 1381 | break; |
1384 | } | 1382 | } |
1385 | /* fall through */ | 1383 | /* fall through */ |
@@ -1411,14 +1409,14 @@ static void do_action(int action, struct cardstate *cs, | |||
1411 | case ACT_ABORTDIAL: /* error/timeout during dial preparation */ | 1409 | case ACT_ABORTDIAL: /* error/timeout during dial preparation */ |
1412 | cs->cur_at_seq = SEQ_NONE; | 1410 | cs->cur_at_seq = SEQ_NONE; |
1413 | at_state->pending_commands |= PC_HUP; | 1411 | at_state->pending_commands |= PC_HUP; |
1414 | atomic_set(&cs->commands_pending, 1); | 1412 | cs->commands_pending = 1; |
1415 | break; | 1413 | break; |
1416 | 1414 | ||
1417 | case ACT_REMOTEREJECT: /* DISCONNECT_IND after dialling */ | 1415 | case ACT_REMOTEREJECT: /* DISCONNECT_IND after dialling */ |
1418 | case ACT_CONNTIMEOUT: /* timeout waiting for ZSAU=ACTIVE */ | 1416 | case ACT_CONNTIMEOUT: /* timeout waiting for ZSAU=ACTIVE */ |
1419 | case ACT_REMOTEHUP: /* DISCONNECT_IND with established connection */ | 1417 | case ACT_REMOTEHUP: /* DISCONNECT_IND with established connection */ |
1420 | at_state->pending_commands |= PC_HUP; | 1418 | at_state->pending_commands |= PC_HUP; |
1421 | atomic_set(&cs->commands_pending, 1); | 1419 | cs->commands_pending = 1; |
1422 | break; | 1420 | break; |
1423 | case ACT_GETSTRING: /* warning: RING, ZDLE, ... | 1421 | case ACT_GETSTRING: /* warning: RING, ZDLE, ... |
1424 | are not handled properly anymore */ | 1422 | are not handled properly anymore */ |
@@ -1515,7 +1513,7 @@ static void do_action(int action, struct cardstate *cs, | |||
1515 | break; | 1513 | break; |
1516 | case ACT_HUP: | 1514 | case ACT_HUP: |
1517 | at_state->pending_commands |= PC_HUP; | 1515 | at_state->pending_commands |= PC_HUP; |
1518 | atomic_set(&cs->commands_pending, 1); | 1516 | cs->commands_pending = 1; |
1519 | gig_dbg(DEBUG_CMD, "Scheduling PC_HUP"); | 1517 | gig_dbg(DEBUG_CMD, "Scheduling PC_HUP"); |
1520 | break; | 1518 | break; |
1521 | 1519 | ||
@@ -1558,7 +1556,7 @@ static void do_action(int action, struct cardstate *cs, | |||
1558 | cs->at_state.pending_commands |= PC_UMMODE; | 1556 | cs->at_state.pending_commands |= PC_UMMODE; |
1559 | gig_dbg(DEBUG_CMD, "Scheduling PC_UMMODE"); | 1557 | gig_dbg(DEBUG_CMD, "Scheduling PC_UMMODE"); |
1560 | } | 1558 | } |
1561 | atomic_set(&cs->commands_pending, 1); | 1559 | cs->commands_pending = 1; |
1562 | } | 1560 | } |
1563 | spin_unlock_irqrestore(&cs->lock, flags); | 1561 | spin_unlock_irqrestore(&cs->lock, flags); |
1564 | cs->waiting = 0; | 1562 | cs->waiting = 0; |
@@ -1741,7 +1739,7 @@ static void process_command_flags(struct cardstate *cs) | |||
1741 | int sequence; | 1739 | int sequence; |
1742 | unsigned long flags; | 1740 | unsigned long flags; |
1743 | 1741 | ||
1744 | atomic_set(&cs->commands_pending, 0); | 1742 | cs->commands_pending = 0; |
1745 | 1743 | ||
1746 | if (cs->cur_at_seq) { | 1744 | if (cs->cur_at_seq) { |
1747 | gig_dbg(DEBUG_CMD, "not searching scheduled commands: busy"); | 1745 | gig_dbg(DEBUG_CMD, "not searching scheduled commands: busy"); |
@@ -1779,7 +1777,7 @@ static void process_command_flags(struct cardstate *cs) | |||
1779 | ~(PC_DLE1 | PC_ACCEPT | PC_DIAL); | 1777 | ~(PC_DLE1 | PC_ACCEPT | PC_DIAL); |
1780 | if (at_state->cid > 0) | 1778 | if (at_state->cid > 0) |
1781 | at_state->pending_commands |= PC_HUP; | 1779 | at_state->pending_commands |= PC_HUP; |
1782 | if (atomic_read(&cs->mstate) == MS_RECOVER) { | 1780 | if (cs->mstate == MS_RECOVER) { |
1783 | if (at_state->pending_commands & PC_CID) { | 1781 | if (at_state->pending_commands & PC_CID) { |
1784 | at_state->pending_commands |= PC_NOCID; | 1782 | at_state->pending_commands |= PC_NOCID; |
1785 | at_state->pending_commands &= ~PC_CID; | 1783 | at_state->pending_commands &= ~PC_CID; |
@@ -1793,7 +1791,7 @@ static void process_command_flags(struct cardstate *cs) | |||
1793 | if (cs->at_state.pending_commands == PC_UMMODE | 1791 | if (cs->at_state.pending_commands == PC_UMMODE |
1794 | && !cs->cidmode | 1792 | && !cs->cidmode |
1795 | && list_empty(&cs->temp_at_states) | 1793 | && list_empty(&cs->temp_at_states) |
1796 | && atomic_read(&cs->mode) == M_CID) { | 1794 | && cs->mode == M_CID) { |
1797 | sequence = SEQ_UMMODE; | 1795 | sequence = SEQ_UMMODE; |
1798 | at_state = &cs->at_state; | 1796 | at_state = &cs->at_state; |
1799 | for (i = 0; i < cs->channels; ++i) { | 1797 | for (i = 0; i < cs->channels; ++i) { |
@@ -1860,7 +1858,7 @@ static void process_command_flags(struct cardstate *cs) | |||
1860 | } | 1858 | } |
1861 | if (cs->at_state.pending_commands & PC_CIDMODE) { | 1859 | if (cs->at_state.pending_commands & PC_CIDMODE) { |
1862 | cs->at_state.pending_commands &= ~PC_CIDMODE; | 1860 | cs->at_state.pending_commands &= ~PC_CIDMODE; |
1863 | if (atomic_read(&cs->mode) == M_UNIMODEM) { | 1861 | if (cs->mode == M_UNIMODEM) { |
1864 | cs->retry_count = 1; | 1862 | cs->retry_count = 1; |
1865 | schedule_sequence(cs, &cs->at_state, SEQ_CIDMODE); | 1863 | schedule_sequence(cs, &cs->at_state, SEQ_CIDMODE); |
1866 | return; | 1864 | return; |
@@ -1886,11 +1884,11 @@ static void process_command_flags(struct cardstate *cs) | |||
1886 | return; | 1884 | return; |
1887 | } | 1885 | } |
1888 | if (bcs->at_state.pending_commands & PC_CID) { | 1886 | if (bcs->at_state.pending_commands & PC_CID) { |
1889 | switch (atomic_read(&cs->mode)) { | 1887 | switch (cs->mode) { |
1890 | case M_UNIMODEM: | 1888 | case M_UNIMODEM: |
1891 | cs->at_state.pending_commands |= PC_CIDMODE; | 1889 | cs->at_state.pending_commands |= PC_CIDMODE; |
1892 | gig_dbg(DEBUG_CMD, "Scheduling PC_CIDMODE"); | 1890 | gig_dbg(DEBUG_CMD, "Scheduling PC_CIDMODE"); |
1893 | atomic_set(&cs->commands_pending, 1); | 1891 | cs->commands_pending = 1; |
1894 | return; | 1892 | return; |
1895 | #ifdef GIG_MAYINITONDIAL | 1893 | #ifdef GIG_MAYINITONDIAL |
1896 | case M_UNKNOWN: | 1894 | case M_UNKNOWN: |
@@ -1926,7 +1924,7 @@ static void process_events(struct cardstate *cs) | |||
1926 | for (i = 0; i < 2 * MAX_EVENTS; ++i) { | 1924 | for (i = 0; i < 2 * MAX_EVENTS; ++i) { |
1927 | tail = cs->ev_tail; | 1925 | tail = cs->ev_tail; |
1928 | if (tail == head) { | 1926 | if (tail == head) { |
1929 | if (!check_flags && !atomic_read(&cs->commands_pending)) | 1927 | if (!check_flags && !cs->commands_pending) |
1930 | break; | 1928 | break; |
1931 | check_flags = 0; | 1929 | check_flags = 0; |
1932 | spin_unlock_irqrestore(&cs->ev_lock, flags); | 1930 | spin_unlock_irqrestore(&cs->ev_lock, flags); |
@@ -1934,7 +1932,7 @@ static void process_events(struct cardstate *cs) | |||
1934 | spin_lock_irqsave(&cs->ev_lock, flags); | 1932 | spin_lock_irqsave(&cs->ev_lock, flags); |
1935 | tail = cs->ev_tail; | 1933 | tail = cs->ev_tail; |
1936 | if (tail == head) { | 1934 | if (tail == head) { |
1937 | if (!atomic_read(&cs->commands_pending)) | 1935 | if (!cs->commands_pending) |
1938 | break; | 1936 | break; |
1939 | continue; | 1937 | continue; |
1940 | } | 1938 | } |
@@ -1971,7 +1969,7 @@ void gigaset_handle_event(unsigned long data) | |||
1971 | struct cardstate *cs = (struct cardstate *) data; | 1969 | struct cardstate *cs = (struct cardstate *) data; |
1972 | 1970 | ||
1973 | /* handle incoming data on control/common channel */ | 1971 | /* handle incoming data on control/common channel */ |
1974 | if (atomic_read(&cs->inbuf->head) != atomic_read(&cs->inbuf->tail)) { | 1972 | if (cs->inbuf->head != cs->inbuf->tail) { |
1975 | gig_dbg(DEBUG_INTR, "processing new data"); | 1973 | gig_dbg(DEBUG_INTR, "processing new data"); |
1976 | cs->ops->handle_input(cs->inbuf); | 1974 | cs->ops->handle_input(cs->inbuf); |
1977 | } | 1975 | } |