First, with our current implementation, we'll never have more than one active data call.  Even with the MMS changes, this will bump to 2 calls at max.  I'm not sure what the max_cids returned by a MTK modem is, but if it's much higher than 2, then this seems like wasted cycles.  Would hard-coding this at 2, or requesting the current number of CIDs from gprs_context be a better approach?

Also, as this function is 100+ lines, it'd also be nice to extract this loop into its own function.