Changeset 9f22213 in mainline for generic/src/ipc/ipcrsc.c
- Timestamp:
- 2006-03-19T12:43:12Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7c7aae16
- Parents:
- b4b45210
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/ipc/ipcrsc.c
rb4b45210 r9f22213 71 71 * calls are answered, the phone is deallocated. 72 72 * 73 * *** The answerbox hangs up (ipc_answer(ESLAM)) 74 * - The phone is disconnected. IPC_M_ANSWERBOX_HUNGUP notification 75 * is sent to source task, the calling process is expected to 73 * *** The answerbox hangs up (ipc_answer(EHANGUP)) 74 * - The phone is disconnected. EHANGUP response code is sent 75 * to the calling process. All new calls through this phone 76 * get a EHUNGUP error code, the task is expected to 76 77 * send an sys_ipc_hangup after cleaning up it's internal structures. 78 * 79 * Call forwarding 80 * 81 * The call can be forwarded, so that the answer to call is passed directly 82 * to the original sender. However, this poses special problems regarding 83 * routing of hangup messages. 84 * 85 * sys_ipc_hangup -> IPC_M_PHONE_HUNGUP 86 * - this message CANNOT be forwarded 87 * 88 * EHANGUP during forward 89 * - The *forwarding* phone will be closed, EFORWARD is sent to receiver. 90 * 91 * EHANGUP, ENOENT during forward 92 * - EFORWARD is sent to the receiver, ipc_forward returns error code EFORWARD 77 93 * 78 94 * Cleanup strategy 79 95 * 80 * 1) Disconnect all our phones (' sys_ipc_hangup')96 * 1) Disconnect all our phones ('ipc_phone_hangup'). 81 97 * 82 98 * 2) Disconnect all phones connected to answerbox. 83 * * Send message 'PHONE_DISCONNECTED' to the target application84 * - Once all phones are disconnected, no further calls can arrive85 99 * 86 100 * 3) Answer all messages in 'calls' and 'dispatched_calls' queues with 87 * appropriate error code .101 * appropriate error code (EHANGUP, EFORWARD). 88 102 * 89 * 4) Wait for all async answers to arrive 103 * 4) Wait for all async answers to arrive. 90 104 * 91 105 */ … … 117 131 118 132 for (i=0; i < IPC_MAX_PHONES; i++) { 119 if ( !TASK->phones[i].busy&& !atomic_get(&TASK->phones[i].active_calls)) {120 TASK->phones[i].busy = 1;133 if (TASK->phones[i].busy==IPC_BUSY_FREE && !atomic_get(&TASK->phones[i].active_calls)) { 134 TASK->phones[i].busy = IPC_BUSY_CONNECTING; 121 135 break; 122 136 } … … 137 151 spinlock_lock(&TASK->lock); 138 152 139 ASSERT(TASK->phones[phoneid].busy );153 ASSERT(TASK->phones[phoneid].busy == IPC_BUSY_CONNECTING); 140 154 ASSERT(! TASK->phones[phoneid].callee); 141 155 142 TASK->phones[phoneid].busy = 0;156 TASK->phones[phoneid].busy = IPC_BUSY_FREE; 143 157 spinlock_unlock(&TASK->lock); 144 158 } … … 156 170 phone_t *phone = &TASK->phones[phoneid]; 157 171 158 ASSERT(phone->busy );172 ASSERT(phone->busy == IPC_BUSY_CONNECTING); 159 173 ipc_phone_connect(phone, box); 160 174 }
Note:
See TracChangeset
for help on using the changeset viewer.