This occurs on the channel being assigned from. We need to release this channel and nextChannel. Release of nextChan also occurs if a channel drops out of the main service loop and the nextChan state is still ReassignTarget
| 218 | // We need to release this channel and nextChannel. |
| 219 | // Release of nextChan also occurs if a channel drops out of the main service loop and the nextChan state is still ReassignTarget |
| 220 | void L3LogicalChannel::reassignFailure() |
| 221 | { |
| 222 | ScopedLock lock(gMMLock,__FILE__,__LINE__); |
| 223 | LOG(DEBUG) << this; |
| 224 | // Clean up the next chan we were trying to reassign to. |
| 225 | if (mNextChan) { |
| 226 | devassert(mNextChan->isTCHF()); |
| 227 | mNextChan->chanSetState(L3LogicalChannel::chRequestRelease); // This will probably block the chan for 30 seconds. |
| 228 | // If we never received the ESTABLISH primitive on nextChan, then the service loop is not runnning, |
| 229 | // so it will never detect the change of state on nextChan, so we must free the channel here. |
| 230 | // The service loops check dcch->chanRunning(), so they will not do anything that might try to use the Context we are freeing.. |
| 231 | mNextChan->chanFreeContext(); |
| 232 | mNextChan = NULL; |
| 233 | } else { |
| 234 | LOG(ERR) << "reassignment failure but no nextChan? "<<this; |
| 235 | } |
| 236 | |
| 237 | |
| 238 | // channel()->l3sendm(L3ReleaseComplete(l3ti,l3cause)); // Release the transaction identifier. |
| 239 | // We might as well drop the whole channel. |
| 240 | // Old code had cause 4, but that does not seem right: |
| 241 | // RR Cause 0x04 -- "abnormal release, no activity on the radio path" |
| 242 | // Caller does this now. |
| 243 | //l3sendm(GSM::L3ChannelRelease(L3RRCause::NoActivityOnTheRadio)); |
| 244 | // The MS is supposed to release the channel, which will send a RELEASE primitive up to Layer3 to close the channel. |
| 245 | } |
| 246 | |
| 247 | // Both old and new L3LogicalChannel point to the same MMContext. |
| 248 | // The message arrives on the new channel, but we run this function on the old channel |
no test coverage detected