Browse Source

gsm0710muxd-hack: Don't assert if channel was not opened

When running with mtkfusionrild, it hits the assert. Instead of
crashing, log a warning (as the code apparently used to do before
Mediatek's changes).

Related: abcbcd7cc5/src/gsm0710muxd-hack/src/gsm0710muxd.c (L609-L615)
master
Oliver Smith 4 months ago
parent
commit
d2a529a071
  1. 17
      src/gsm0710muxd-hack/src/gsm0710muxd.c

17
src/gsm0710muxd-hack/src/gsm0710muxd.c

@ -896,27 +896,10 @@ int pseudo_device_read(void *vargp)
/* So, this time's newly read data should be stored to the local buf from the position buf + channel->remaining */
if (!channel->opened) {
/* Note by LS: In our implementation: each non-control channel must be opened at the initialization stage */
Gsm0710Muxd_Assert(GSM0710MUXD_TXTHREAD_ERR);
#if 0
LOGMUX(LOG_WARNING, "Write to a channel which wasn't acked to be open.");
/* [Bug] Note by LS:But it already copied some data to the local buf !*/
/* Possible solution#2: Copy the already read data to channel->tmp buffer */
/* [Question] When to write the data stored in the channel->tmp buffer to the modem? and it may re-enter this function but UA is not received from the modem yet */
/*
* if (len > 0)
* {
* char* previous_channel_tmp = channel->tmp;
* channel->tmp = malloc(len + channel->remaining);
* memcpy(channel->tmp, previous_channel_tmp, channel->remaining);
* memcpy(channel->tmp + channel->remaining, buf, len);
* channel->remaining = len;
* }
*/
write_frame(channel->id, NULL, 0, GSM0710_TYPE_SABM | GSM0710_PF);
LOGMUX(LOG_DEBUG, "Leave");
return 1;
#endif
}
/* Modify by LS */

Loading…
Cancel
Save